max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
tools/autotest.py | zhongxinghong/Botzone-Tank2 | 11 | 6633051 | <filename>tools/autotest.py
# -*- coding: utf-8 -*-
# @Author: Administrator
# @Date: 2019-05-04 02:40:01
# @Last Modified by: Administrator
# @Last Modified time: 2019-05-16 17:31:20
"""
自动化测试工具
------------------
让 bot 过一遍特定的数据集
如果出现 bug 就可以及时修复 ...
和 simulator 使用相同的壳
"""
import sys
sys.path.append("../")
fr... | <filename>tools/autotest.py
# -*- coding: utf-8 -*-
# @Author: Administrator
# @Date: 2019-05-04 02:40:01
# @Last Modified by: Administrator
# @Last Modified time: 2019-05-16 17:31:20
"""
自动化测试工具
------------------
让 bot 过一遍特定的数据集
如果出现 bug 就可以及时修复 ...
和 simulator 使用相同的壳
"""
import sys
sys.path.append("../")
fr... | zh | 0.58096 | # -*- coding: utf-8 -*- # @Author: Administrator # @Date: 2019-05-04 02:40:01 # @Last Modified by: Administrator # @Last Modified time: 2019-05-16 17:31:20 自动化测试工具 ------------------ 让 bot 过一遍特定的数据集 如果出现 bug 就可以及时修复 ... 和 simulator 使用相同的壳 # 配置文件写错 ## 环境变量设置 ## # to abspath | 1.943787 | 2 |
src/OrganMatching/views.py | ShikharJ/Organ-Exchange | 2 | 6633052 | <filename>src/OrganMatching/views.py<gh_stars>1-10
from django.http import HttpResponse
from django.shortcuts import render, redirect
from OrganMatching.misc import *
from OrganMatching.algo import *
blood_groups = ["A", "B", "AB", "O"]
rhesus_factors = ["+", "-"]
reports = ["Positive", "Negative"]
def index(request... | <filename>src/OrganMatching/views.py<gh_stars>1-10
from django.http import HttpResponse
from django.shortcuts import render, redirect
from OrganMatching.misc import *
from OrganMatching.algo import *
blood_groups = ["A", "B", "AB", "O"]
rhesus_factors = ["+", "-"]
reports = ["Positive", "Negative"]
def index(request... | de | 0.749618 | ############### UNCOMMENT FOR NO AUTHENTICATION ################ ################################################################ | 2.202374 | 2 |
django_airavata/wagtailapps/base/models.py | vivekshresta/airavata-django-portal | 0 | 6633053 | from __future__ import unicode_literals
import os
from django.db import models
from modelcluster.fields import ParentalKey
from modelcluster.models import ClusterableModel
from wagtail.admin.edit_handlers import (
FieldPanel,
InlinePanel,
MultiFieldPanel,
ObjectList,
PageChooserPanel,
StreamFi... | from __future__ import unicode_literals
import os
from django.db import models
from modelcluster.fields import ParentalKey
from modelcluster.models import ClusterableModel
from wagtail.admin.edit_handlers import (
FieldPanel,
InlinePanel,
MultiFieldPanel,
ObjectList,
PageChooserPanel,
StreamFi... | en | 0.700359 | This provides editable text for the site announcements. Again it uses the decorator `register_snippet` to allow it to be accessible via the admin. It is made accessible on the template via a template tag defined in base/templatetags/ navigation_tags.py This provides editable text for the site extra navbar w... | 2.042341 | 2 |
assignments/assignment2/model.py | kstepanovdev/dlcourse_ai | 0 | 6633054 | <filename>assignments/assignment2/model.py
import numpy as np
from layers import FullyConnectedLayer, ReLULayer, softmax_with_cross_entropy, l2_regularization
class TwoLayerNet:
""" Neural network with two fully connected layers """
def __init__(self, n_input, n_output, hidden_layer_size, reg):
"""
... | <filename>assignments/assignment2/model.py
import numpy as np
from layers import FullyConnectedLayer, ReLULayer, softmax_with_cross_entropy, l2_regularization
class TwoLayerNet:
""" Neural network with two fully connected layers """
def __init__(self, n_input, n_output, hidden_layer_size, reg):
"""
... | en | 0.595795 | Neural network with two fully connected layers Initializes the neural network Arguments: n_input, int - dimension of the model input n_output, int - number of classes to predict hidden_layer_size, int - number of neurons in the hidden layer reg, float - L2 regularization strengt... | 3.675115 | 4 |
python/tetris/main.py | klenium/tetris | 2 | 6633055 | <gh_stars>1-10
from tetris.logic.TetrisGame import TetrisGame
from tetris.util.containers import Dimension
from tetris.view.GraphicGameFrame import GraphicGameFrame
def run_game(rows, cols, size, speed, controls):
grid_size = Dimension(cols, rows)
square_size = size
falling_speed = speed
frame = Graph... | from tetris.logic.TetrisGame import TetrisGame
from tetris.util.containers import Dimension
from tetris.view.GraphicGameFrame import GraphicGameFrame
def run_game(rows, cols, size, speed, controls):
grid_size = Dimension(cols, rows)
square_size = size
falling_speed = speed
frame = GraphicGameFrame(gri... | none | 1 | 2.825911 | 3 | |
cri/intake.py | oldnick85/CResourceIntake | 0 | 6633056 | #!/usr/bin/env python3
import sys
import json
def main(args):
rsrcs = CResources(sys.argv)
rsrcs.proc()
return 0
class CResources:
resources_path = ""
sources_path = ""
namespace = None
def __init__(self, argv):
for arg in sys.argv:
if (arg.find("--resources-path=") == 0):
self.resources_path = ... | #!/usr/bin/env python3
import sys
import json
def main(args):
rsrcs = CResources(sys.argv)
rsrcs.proc()
return 0
class CResources:
resources_path = ""
sources_path = ""
namespace = None
def __init__(self, argv):
for arg in sys.argv:
if (arg.find("--resources-path=") == 0):
self.resources_path = ... | fr | 0.221828 | #!/usr/bin/env python3 | 2.761117 | 3 |
code_cracker (numbers).py | ThatGuyCalledJesse/brute_force_attack | 0 | 6633057 | <gh_stars>0
import random
import time
codePart1 = input('Enter the first part of your code: ')
codePart2 = input('Enter the second part of your code: ')
codePart3 = input('Enter the third part of your code: ')
codePart4 = input('Enter the fourth part of your code: ')
code = (codePart1, codePart2, codePart3, cod... | import random
import time
codePart1 = input('Enter the first part of your code: ')
codePart2 = input('Enter the second part of your code: ')
codePart3 = input('Enter the third part of your code: ')
codePart4 = input('Enter the fourth part of your code: ')
code = (codePart1, codePart2, codePart3, codePart4)
pos... | none | 1 | 3.622958 | 4 | |
tests/bindings/test_node_path.py | garyo/godot-python | 0 | 6633058 | import pytest
from godot.bindings import NodePath, Vector3
class TestNodePath:
def test_equal(self):
v1 = NodePath("parent/child")
v2 = NodePath("parent/child")
assert v1 == v2
other = NodePath("parent/other_child")
assert not v1 == other # Force use of __eq__
@pyte... | import pytest
from godot.bindings import NodePath, Vector3
class TestNodePath:
def test_equal(self):
v1 = NodePath("parent/child")
v2 = NodePath("parent/child")
assert v1 == v2
other = NodePath("parent/other_child")
assert not v1 == other # Force use of __eq__
@pyte... | en | 0.80935 | # Force use of __eq__ # Don't test methods' validity but bindings one | 2.555259 | 3 |
test.py | andy971022/CWGP | 7 | 6633059 | import matplotlib.pyplot as plt
import autograd.numpy as np
import seaborn as sns
from scipy import stats
from cwgp.cwgp import CWGP
from cwgp.grid_search import grid_search
import cwgp
print(cwgp)
np.random.seed(seed=32)
SIZE = 70
betas = np.random.exponential(scale=5, size=SIZE)
sns.distplot(betas)
plt.show()
c... | import matplotlib.pyplot as plt
import autograd.numpy as np
import seaborn as sns
from scipy import stats
from cwgp.cwgp import CWGP
from cwgp.grid_search import grid_search
import cwgp
print(cwgp)
np.random.seed(seed=32)
SIZE = 70
betas = np.random.exponential(scale=5, size=SIZE)
sns.distplot(betas)
plt.show()
c... | en | 0.426464 | # stats.probplot(y_train, dist="norm", plot=plt) # stats.probplot(y_val, dist="norm", plot=plt) # second param is a place holder # should give 9^3 combinations # grid_search( # estimator, betas, np.arange(SIZE, dtype="float"), { # "c": 1, "transformations": [ # "sa"]}, test="hi") | 2.386594 | 2 |
epush_bot.py | yuiokjgft/pods | 16 | 6633060 | <filename>epush_bot.py
import telebot
import os
from config import *
from flask import Flask, request
server = Flask(__name__)
import importdir
importdir.do("features", globals())
@server.route('/'+ TOKEN, methods=['POST'])
def getMessage():
request_object = request.stream.read().decode("utf-8")
update_to_jso... | <filename>epush_bot.py
import telebot
import os
from config import *
from flask import Flask, request
server = Flask(__name__)
import importdir
importdir.do("features", globals())
@server.route('/'+ TOKEN, methods=['POST'])
def getMessage():
request_object = request.stream.read().decode("utf-8")
update_to_jso... | none | 1 | 2.388945 | 2 | |
tests/test_08_config/test_filters.py | primal100/aionetworking | 0 | 6633061 | <reponame>primal100/aionetworking<filename>tests/test_08_config/test_filters.py
import logging
import operator
import pytest
from aionetworking.utils import Expression, in_
class TestExpression:
@pytest.mark.parametrize('attr,obj', (
[None, False],
['self', False],
['method', T... | import logging
import operator
import pytest
from aionetworking.utils import Expression, in_
class TestExpression:
@pytest.mark.parametrize('attr,obj', (
[None, False],
['self', False],
['method', True]
))
def test_01_expression(self, attr, obj, json_rpc_login_request_o... | none | 1 | 2.43136 | 2 | |
lightautoml/text/utils.py | Zhurik/LightAutoML | 0 | 6633062 | """Text utility script."""
import os
import random
from typing import Dict, List, Sequence
import numpy as np
import torch
from log_calls import record_history
from sklearn.utils.murmurhash import murmurhash3_32
_dtypes_mapping = {'label': 'float',
'cat': 'long',
'cont': 'float'... | """Text utility script."""
import os
import random
from typing import Dict, List, Sequence
import numpy as np
import torch
from log_calls import record_history
from sklearn.utils.murmurhash import murmurhash3_32
_dtypes_mapping = {'label': 'float',
'cat': 'long',
'cont': 'float'... | en | 0.681339 | Text utility script. # embeddings Inverse sigmoid transformation. Args: x: Input array. Returns: Transformed array. Variant of inverse softmax transformation with zero constant term. Args: x: Input array. Returns: Transformed array. Whether shuffle input. Args: ... | 2.477824 | 2 |
data/external/repositories/137656/blundercheck-master/combine/contest_20150213a/modeling/fit_linear_pgmodel.py | Keesiu/meta-kaggle | 0 | 6633063 | <filename>data/external/repositories/137656/blundercheck-master/combine/contest_20150213a/modeling/fit_linear_pgmodel.py
#!/usr/bin/env python
import sys, time
import numpy as np
import cPickle as pickle
from pandas import DataFrame
from pandas import read_pickle
from pandas import get_dummies
import statsmodels.formu... | <filename>data/external/repositories/137656/blundercheck-master/combine/contest_20150213a/modeling/fit_linear_pgmodel.py
#!/usr/bin/env python
import sys, time
import numpy as np
import cPickle as pickle
from pandas import DataFrame
from pandas import read_pickle
from pandas import get_dummies
import statsmodels.formu... | en | 0.73992 | #!/usr/bin/env python # TODO save the dummies along with yy_df # TODO save the moveelo_features along with yy_df # Never mind these, they didnt help much #formula_rhs = formula_rhs + " + " + " + ".join(moveelo_features) | 1.841076 | 2 |
PyScripts/New-KeeperRecordAttachment.py | tonylanglet/keepersecurity-powershell | 2 | 6633064 | <filename>PyScripts/New-KeeperRecordAttachment.py
import sys
import getopt
import getpass
import string
import argparse
from keepercommander.record import Record
from keepercommander.commands.record import RecordUploadAttachmentCommand
from keepercommander.params import KeeperParams
from keepercommander import display... | <filename>PyScripts/New-KeeperRecordAttachment.py
import sys
import getopt
import getpass
import string
import argparse
from keepercommander.record import Record
from keepercommander.commands.record import RecordUploadAttachmentCommand
from keepercommander.params import KeeperParams
from keepercommander import display... | en | 0.575125 | # MAIN FUNCTION # Authentication credentials # Arguments # KEEPER COMMAND | 2.993375 | 3 |
blur/estimation/CNN/main.py | MaikWischow/Camera-Condition-Monitoring | 3 | 6633065 | import numpy as np
import os
import math
import glob
import cv2
from buildModel import MTFNet
from imgProcessing import preProcessTestImages
from prepareTrainingData import readTFRecordDataset
import tensorflow as tf
from tensorflow.python.keras.models import load_model, Model
from tensorflow.python import keras
from ... | import numpy as np
import os
import math
import glob
import cv2
from buildModel import MTFNet
from imgProcessing import preProcessTestImages
from prepareTrainingData import readTFRecordDataset
import tensorflow as tf
from tensorflow.python.keras.models import load_model, Model
from tensorflow.python import keras
from ... | en | 0.697951 | # Only for function "estimateObjDetsMTF" Load or create a CNN model for MTF estimation. :param modelPath: Path to a CNN model to load. :return: Ready-to-use CNN model. # Preparation # Load or create CNN model # Compile CNN model Auxiliary function to extract the fully-connected sub-model. :param mainModel: ... | 2.425426 | 2 |
archivebox/parsers/shaarli_rss.py | TrAyZeN/ArchiveBox | 1 | 6633066 | <filename>archivebox/parsers/shaarli_rss.py
__package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
str_between,
)
@enforce_types
def parse_shaarli_rss_export(rss_file: IO[str], **_k... | <filename>archivebox/parsers/shaarli_rss.py
__package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
str_between,
)
@enforce_types
def parse_shaarli_rss_export(rss_file: IO[str], **_k... | de | 0.29027 | Parse Shaarli-specific RSS XML-format files into links # example entry: # <entry> # <title>Aktuelle Trojaner-Welle: Emotet lauert in gefälschten Rechnungsmails | heise online</title> # <link href="https://www.heise.de/security/meldung/Aktuelle-Trojaner-Welle-Emotet-lauert-in-gefaelschten-Rechnungsmails-4291268.htm... | 2.635908 | 3 |
grafana_backup/create_datasource.py | Keimille/grafana-backup-tool | 515 | 6633067 | import json
from grafana_backup.dashboardApi import create_datasource
def main(args, settings, file_path):
grafana_url = settings.get('GRAFANA_URL')
http_post_headers = settings.get('HTTP_POST_HEADERS')
verify_ssl = settings.get('VERIFY_SSL')
client_cert = settings.get('CLIENT_CERT')
debug = setti... | import json
from grafana_backup.dashboardApi import create_datasource
def main(args, settings, file_path):
grafana_url = settings.get('GRAFANA_URL')
http_post_headers = settings.get('HTTP_POST_HEADERS')
verify_ssl = settings.get('VERIFY_SSL')
client_cert = settings.get('CLIENT_CERT')
debug = setti... | none | 1 | 2.593093 | 3 | |
pciSeq/src/preprocess/cell_merger.py | acycliq/pciSeq | 10 | 6633068 | <gh_stars>1-10
import os
import shutil
import logging
import itertools
import numpy as np
from collections import defaultdict
from pciSeq.src.preprocess.post import Post_merge
from pciSeq.src.preprocess.utils import _to_csr_matrix, _get_connected_labels
from scipy.sparse.csgraph import connected_components
logging.bas... | import os
import shutil
import logging
import itertools
import numpy as np
from collections import defaultdict
from pciSeq.src.preprocess.post import Post_merge
from pciSeq.src.preprocess.utils import _to_csr_matrix, _get_connected_labels
from scipy.sparse.csgraph import connected_components
logging.basicConfig(
l... | en | 0.810018 | # replace the register # ---------------------------------------------------------------------------------------------------------------------- # ti Mutates in-place the tile object by adding two more key/value pairs Parameters ---------- spots_all: dataframe Contains all the spots ... | 2.258586 | 2 |
check.py | nhmanas/amdgpu-pro-fans-gui | 0 | 6633069 | <reponame>nhmanas/amdgpu-pro-fans-gui
import subprocess
def temp():
return subprocess.run(["watch", "-n", "2", "sensors"]) | import subprocess
def temp():
return subprocess.run(["watch", "-n", "2", "sensors"]) | none | 1 | 1.90302 | 2 | |
tan/experiments/trainer.py | leao1995/tan | 0 | 6633070 | import tensorflow as tf
import numpy as np
import os
TRAIN = 'train'
VALID = 'valid'
TEST = 'test'
# TODO: chance name.
class RedTrainer:
"""Encapsulates the logic for training a sequence model.
Args:
fetchers: A dictionary of fetchers for training, validation, and testing
datasets-
... | import tensorflow as tf
import numpy as np
import os
TRAIN = 'train'
VALID = 'valid'
TEST = 'test'
# TODO: chance name.
class RedTrainer:
"""Encapsulates the logic for training a sequence model.
Args:
fetchers: A dictionary of fetchers for training, validation, and testing
datasets-
... | en | 0.678481 | # TODO: chance name. Encapsulates the logic for training a sequence model. Args: fetchers: A dictionary of fetchers for training, validation, and testing datasets- {TRAIN: train_fetcher, VALID: valid_fetcher, TEST: test_fetcher}. Each fetcher implements functions ... | 3.054976 | 3 |
blender-processing-scripts/render/asset_thumbnail.py | MikeFesta/3xr | 7 | 6633071 | # SPDX-License-Identifier: Apache-2.0
import bpy
import math
import os
import time
from xrs import automate as xra
xra.log_info('Rendering Asset Thumbnail')
arguments = xra.get_command_line_arguments()
working_dir = arguments[0]
asset_name = arguments[1]
asset_blend = working_dir + asset_name + '.blend'
xra.log_info(... | # SPDX-License-Identifier: Apache-2.0
import bpy
import math
import os
import time
from xrs import automate as xra
xra.log_info('Rendering Asset Thumbnail')
arguments = xra.get_command_line_arguments()
working_dir = arguments[0]
asset_name = arguments[1]
asset_blend = working_dir + asset_name + '.blend'
xra.log_info(... | en | 0.638381 | # SPDX-License-Identifier: Apache-2.0 # Exit if the collection couldn't be loaded # Relink the textures to the current directory # Render Engine Setup (Note: Eevee not supported headless) #https://devtalk.blender.org/t/blender-2-8-unable-to-open-a-display-by-the-rendering-on-the-background-eevee/1436/24 #TODO: experime... | 2.108905 | 2 |
tests/unit/flow/test_flow_except.py | yk/jina | 1 | 6633072 | import numpy as np
from jina.executors.crafters import BaseCrafter
from jina.flow import Flow
from jina.proto import jina_pb2
class DummyCrafter(BaseCrafter):
def craft(self, *args, **kwargs):
return 1 / 0
def test_bad_flow(mocker):
def validate(req):
bad_routes = [r for r in req.routes if ... | import numpy as np
from jina.executors.crafters import BaseCrafter
from jina.flow import Flow
from jina.proto import jina_pb2
class DummyCrafter(BaseCrafter):
def craft(self, *args, **kwargs):
return 1 / 0
def test_bad_flow(mocker):
def validate(req):
bad_routes = [r for r in req.routes if ... | en | 0.959779 | # always test two times, make sure the flow still works after it fails on the first # always test two times, make sure the flow still works after it fails on the first # always test two times, make sure the flow still works after it fails on the first # gateway, r1, r3, gateway | 2.251573 | 2 |
metabolite_database/main/forms.py | lparsons/metabolite_database | 0 | 6633073 | from flask_wtf import FlaskForm
from wtforms import SelectField, SelectMultipleField, SubmitField, widgets
from wtforms.validators import DataRequired, InputRequired
class MultiCheckboxField(SelectMultipleField):
"""
A multiple-select, except displays a list of checkboxes.
Iterating the field will produc... | from flask_wtf import FlaskForm
from wtforms import SelectField, SelectMultipleField, SubmitField, widgets
from wtforms.validators import DataRequired, InputRequired
class MultiCheckboxField(SelectMultipleField):
"""
A multiple-select, except displays a list of checkboxes.
Iterating the field will produc... | en | 0.691985 | A multiple-select, except displays a list of checkboxes. Iterating the field will produce subfields, allowing custom rendering of the enclosed checkbox fields. | 2.769108 | 3 |
server/tests/test_timeserials_job.py | data2068/dataplay3 | 153 | 6633074 | <gh_stars>100-1000
from dataplay.mlsvc.job import MLJobStatus
from dataplay.mlsvc.time_serials import TimeSerialsForecastsJob
from dataplay.datasvc.manager import DatasetManager
def test_job_time_serials():
dataset_id = 'air_passengers'
dataset = DatasetManager.get_dataset(dataset_id)
assert dataset is no... | from dataplay.mlsvc.job import MLJobStatus
from dataplay.mlsvc.time_serials import TimeSerialsForecastsJob
from dataplay.datasvc.manager import DatasetManager
def test_job_time_serials():
dataset_id = 'air_passengers'
dataset = DatasetManager.get_dataset(dataset_id)
assert dataset is not None
df = dat... | en | 0.819534 | # job.clean() | 2.416675 | 2 |
pihole/tests/conftest.py | divyamamgai/integrations-extras | 158 | 6633075 | <gh_stars>100-1000
import os
import time
import pytest
from datadog_checks.dev import docker_run, get_here
HOST = 'localhost:8888/pass'
URL = 'http://localhost:8888/pass/admin/api.php'
INSTANCE = {'host': HOST}
@pytest.fixture(scope='session')
def dd_environment_pass():
compose_file = os.path.join(get_here(), ... | import os
import time
import pytest
from datadog_checks.dev import docker_run, get_here
HOST = 'localhost:8888/pass'
URL = 'http://localhost:8888/pass/admin/api.php'
INSTANCE = {'host': HOST}
@pytest.fixture(scope='session')
def dd_environment_pass():
compose_file = os.path.join(get_here(), 'docker-compose.yam... | none | 1 | 1.797223 | 2 | |
upbitpy/TradeShow.py | wonseok0403/upbitpy | 0 | 6633076 | <filename>upbitpy/TradeShow.py<gh_stars>0
from upbitpy import Upbitpy
upbitpy = Upbitpy()
allMarket = upbitpy.get_market_all()
KRWList = []
BTCList = []
def GetBTCList(MarketList):
List = []
for i in MarketList :
if( i['market'][0:3] == 'BTC' ) :
List.append(i['market'])
global BTCList
BTCList = List
def ... | <filename>upbitpy/TradeShow.py<gh_stars>0
from upbitpy import Upbitpy
upbitpy = Upbitpy()
allMarket = upbitpy.get_market_all()
KRWList = []
BTCList = []
def GetBTCList(MarketList):
List = []
for i in MarketList :
if( i['market'][0:3] == 'BTC' ) :
List.append(i['market'])
global BTCList
BTCList = List
def ... | none | 1 | 2.751129 | 3 | |
frappe-bench/apps/erpnext/erpnext/regional/india/__init__.py | Semicheche/foa_frappe_docker | 0 | 6633077 | <filename>frappe-bench/apps/erpnext/erpnext/regional/india/__init__.py
states = [
'',
'Andaman and Nicobar Islands',
'Andhra Pradesh',
'Arunachal Pradesh',
'Assam',
'Bihar',
'Chandigarh',
'Chhattisgarh',
'Dadra and Nagar Haveli',
'Daman and Diu',
'Delhi',
'Goa',
'Gujarat',
'Haryana',
'Himachal Pradesh',
... | <filename>frappe-bench/apps/erpnext/erpnext/regional/india/__init__.py
states = [
'',
'Andaman and Nicobar Islands',
'Andhra Pradesh',
'Arunachal Pradesh',
'Assam',
'Bihar',
'Chandigarh',
'Chhattisgarh',
'Dadra and Nagar Haveli',
'Daman and Diu',
'Delhi',
'Goa',
'Gujarat',
'Haryana',
'Himachal Pradesh',
... | none | 1 | 1.36847 | 1 | |
py/garage/garage/http/handlers.py | clchiou/garage | 3 | 6633078 | <reponame>clchiou/garage<filename>py/garage/garage/http/handlers.py
"""HTTP request handlers."""
__all__ = [
'ApiEndpointHandler',
'UriPath',
'add_date_to_headers',
'parse_request',
]
from pathlib import PurePosixPath as UriPath
import datetime
import urllib.parse
import http2
from garage.assertions... | """HTTP request handlers."""
__all__ = [
'ApiEndpointHandler',
'UriPath',
'add_date_to_headers',
'parse_request',
]
from pathlib import PurePosixPath as UriPath
import datetime
import urllib.parse
import http2
from garage.assertions import ASSERT
from . import servers
class ApiEndpointHandler:
... | en | 0.806232 | HTTP request handlers. Request handler of an API endpoint. Add 'Date' field to headers without checking its presence. This modifies headers *in place*. # We can't handle non-UTC time zone at the moment. | 2.914008 | 3 |
old-projects/calculator.py | waitblock/gists | 3 | 6633079 | z=0
x=int(raw_input("\nType in your first number:"))
y=int(raw_input("\nType in your second number:"))
i=int(raw_input("\nWhat operation do you want to do? (enter 1=+, 2=-, 3=*, 4=/):"))
while z == 0:
if i==1:
a=x+y
print (a)
z=1
if i==2:
a=x-y
print (a)
... | z=0
x=int(raw_input("\nType in your first number:"))
y=int(raw_input("\nType in your second number:"))
i=int(raw_input("\nWhat operation do you want to do? (enter 1=+, 2=-, 3=*, 4=/):"))
while z == 0:
if i==1:
a=x+y
print (a)
z=1
if i==2:
a=x-y
print (a)
... | none | 1 | 3.7961 | 4 | |
modules/ts_utils.py | alceballosa/dengue-project | 0 | 6633080 |
from statsmodels.tsa.seasonal import seasonal_decompose
def within_maximum_range(val, max_val, thres = 0.020):
val = abs(val)
max_val = abs(max_val)
diff = abs(val-max_val)
if diff < thres:
return True
else:
return False
def normalize_timeseries(df, mode = "MES", cols_to_norma... |
from statsmodels.tsa.seasonal import seasonal_decompose
def within_maximum_range(val, max_val, thres = 0.020):
val = abs(val)
max_val = abs(max_val)
diff = abs(val-max_val)
if diff < thres:
return True
else:
return False
def normalize_timeseries(df, mode = "MES", cols_to_norma... | none | 1 | 2.443657 | 2 | |
Bindings/Python/tests/test_states_trajectory.py | justicelee/opensim-core | 2 | 6633081 | <reponame>justicelee/opensim-core<filename>Bindings/Python/tests/test_states_trajectory.py
import os
import unittest
import opensim as osim
test_dir = os.path.join(os.path.dirname(os.path.abspath(osim.__file__)),
'tests')
# Silence warning messages if mesh (.vtp) files cannot be found.
osim.M... | import os
import unittest
import opensim as osim
test_dir = os.path.join(os.path.dirname(os.path.abspath(osim.__file__)),
'tests')
# Silence warning messages if mesh (.vtp) files cannot be found.
osim.Model.setDebugLevel(0)
# TODO add more tests of the integrity checks.
class TestStatesTraj... | en | 0.81023 | # Silence warning messages if mesh (.vtp) files cannot be found. # TODO add more tests of the integrity checks. # Test indexing into the states container. # Test iterator. # Assigning is not allowed, since it easily allows people to violate # the ordering of the trajectory. # Also, the assignment `states.upd(5) = state... | 2.26788 | 2 |
extensions/language.py | yiays/merely | 0 | 6633082 | import discord
from discord.ext import commands
import re
class Language(commands.cog.Cog):
def __init__(self, bot:commands.Bot):
self.bot = bot
# ensure config file has required data
if not bot.config.has_section('language'):
bot.config.add_section('language')
@commands.group()
async def la... | import discord
from discord.ext import commands
import re
class Language(commands.cog.Cog):
def __init__(self, bot:commands.Bot):
self.bot = bot
# ensure config file has required data
if not bot.config.has_section('language'):
bot.config.add_section('language')
@commands.group()
async def la... | en | 0.748364 | # ensure config file has required data user-facing setter/getter for guild/user language options | 2.437822 | 2 |
ixtlilton_tools/_private_tools/exceptions.py | uibcdf/Ixtlilton | 0 | 6633083 | class BadCallError(ValueError):
def __init__(self, message=None):
if message is None:
message = 'Wrong way of invoking this method. Check the online documentation for more information: http://www.uibcdf.org/MolSysMT'
super().__init__(message)
class NotImplementedError(NotImplementedErro... | class BadCallError(ValueError):
def __init__(self, message=None):
if message is None:
message = 'Wrong way of invoking this method. Check the online documentation for more information: http://www.uibcdf.org/MolSysMT'
super().__init__(message)
class NotImplementedError(NotImplementedErro... | none | 1 | 2.702277 | 3 | |
tensorflow_checkpoint_reader/core.py | shawwn/tensorflow-checkpoint-reader | 1 | 6633084 | import struct
import re
import functools
@functools.total_ordering
class StringPiece:
npos = -1
def __init__(self, value=None, size=None, offset=None):
self.set(value)
if offset is not None:
self.remove_prefix(offset)
if size is not None:
self.remove_suffix(self.size() - size)
def data(... | import struct
import re
import functools
@functools.total_ordering
class StringPiece:
npos = -1
def __init__(self, value=None, size=None, offset=None):
self.set(value)
if offset is not None:
self.remove_prefix(offset)
if size is not None:
self.remove_suffix(self.size() - size)
def data(... | en | 0.593323 | Returns the number of characters in the `string_view`. Returns the number of characters in the `string_view`. Alias for `size()`. Checks if the `string_view` is empty (refers to no characters). Removes the first `n` characters from the `string_view`. Note that the underlying string is not changed, only the view. Re... | 3.112394 | 3 |
wlra/vae.py | aksarkar/wlra | 7 | 6633085 | import torch
class Encoder(torch.nn.Module):
"""Encoder q(z | x) = N(mu(x), sigma^2(x))"""
def __init__(self, input_dim, output_dim):
super().__init__()
self.net = torch.nn.Sequential(
torch.nn.Linear(input_dim, 128),
torch.nn.ReLU(),
torch.nn.Linear(128, 128),
torch.nn.ReLU(),
... | import torch
class Encoder(torch.nn.Module):
"""Encoder q(z | x) = N(mu(x), sigma^2(x))"""
def __init__(self, input_dim, output_dim):
super().__init__()
self.net = torch.nn.Sequential(
torch.nn.Linear(input_dim, 128),
torch.nn.ReLU(),
torch.nn.Linear(128, 128),
torch.nn.ReLU(),
... | en | 0.6906 | Encoder q(z | x) = N(mu(x), sigma^2(x)) Decoder p(x | z) ~ Poisson(s_i lambda(z)) KL divergence between N(mean, scale) and N(0, 1) Log likelihood of x distributed as Poisson # [batch_size] # Important: this is analytic # [stoch_samples, batch_size, latent_dim] # [stoch_samples, batch_size, input_dim] # Important: optim... | 2.969267 | 3 |
kreator/controllers/pyramid.py | fearless-spider/kreator-cli | 0 | 6633086 | <reponame>fearless-spider/kreator-cli<gh_stars>0
from cement import Controller, ex
class Pyramid(Controller):
class Meta:
label = 'Pyramid'
stacked_on = 'base'
stacked_type = 'embedded'
# text displayed at the top of --help output
description = 'This component generate pyr... | from cement import Controller, ex
class Pyramid(Controller):
class Meta:
label = 'Pyramid'
stacked_on = 'base'
stacked_type = 'embedded'
# text displayed at the top of --help output
description = 'This component generate pyramid app'
# text displayed at the bottom... | en | 0.422539 | # text displayed at the top of --help output # text displayed at the bottom of --help output Default action if no sub-command is passed. # sub-command level arguments. ex: 'kreator command1 --foo bar' ### add a sample foo option under subcommand namespace Pyramid sub-command. | 2.657121 | 3 |
ttsx/goods/urls.py | GaoHaiBin/freshtest | 0 | 6633087 | from django.conf.urls import url
from freshtest.ttsx.goods import views
urlpatterns = [
url(r'^', views)
] | from django.conf.urls import url
from freshtest.ttsx.goods import views
urlpatterns = [
url(r'^', views)
] | none | 1 | 1.375737 | 1 | |
armory/baseline_models/pytorch/sincnet.py | paperwhite/armory | 0 | 6633088 | """
CNN model for raw audio classification
Model contributed by: MITRE Corporation
Adapted from: https://github.com/mravanelli/SincNet
"""
import logging
from art.classifiers import PyTorchClassifier
import numpy as np
import torch
from torch import nn
# Load model from MITRE external repo: https://github.com/hkaki... | """
CNN model for raw audio classification
Model contributed by: MITRE Corporation
Adapted from: https://github.com/mravanelli/SincNet
"""
import logging
from art.classifiers import PyTorchClassifier
import numpy as np
import torch
from torch import nn
# Load model from MITRE external repo: https://github.com/hkaki... | en | 0.802542 | CNN model for raw audio classification Model contributed by: MITRE Corporation Adapted from: https://github.com/mravanelli/SincNet # Load model from MITRE external repo: https://github.com/hkakitani/SincNet # This needs to be defined in your config's `external_github_repo` field to be # downloaded and placed on the PY... | 2.674443 | 3 |
riddle_bot_source/userinfo.py | anthonysasso2001/Python-Riddle-Bot | 0 | 6633089 | from dataclasses import dataclass
import pickle
@dataclass
class User:
"""Class for user struct / class"""
name: str = "-1"
password: str = <PASSWORD>"
fibonacciScore: int = 0
minesweeperScore: int = 0
def save_user_data(file_name,users):
#
return
def load_user_data(file_name):
r... | from dataclasses import dataclass
import pickle
@dataclass
class User:
"""Class for user struct / class"""
name: str = "-1"
password: str = <PASSWORD>"
fibonacciScore: int = 0
minesweeperScore: int = 0
def save_user_data(file_name,users):
#
return
def load_user_data(file_name):
r... | en | 0.927561 | Class for user struct / class # | 3.179976 | 3 |
validator/sawtooth_validator/execution/scheduler_parallel.py | manojgop/sawtooth-core | 0 | 6633090 | <filename>validator/sawtooth_validator/execution/scheduler_parallel.py
# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/li... | <filename>validator/sawtooth_validator/execution/scheduler_parallel.py
# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/li... | en | 0.933242 | # Copyright 2016-2017 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i... | 2.154305 | 2 |
ntscQT.py | JargeZ/vhs | 43 | 6633091 | import os
import sys
from pathlib import Path
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import QLibraryInfo
from app import NtscApp
from app import logger
os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = QLibraryInfo.location(
QLibraryInfo.PluginsPath
)
def crash_handler(type, value, tb):
logger.tra... | import os
import sys
from pathlib import Path
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import QLibraryInfo
from app import NtscApp
from app import logger
os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = QLibraryInfo.location(
QLibraryInfo.PluginsPath
)
def crash_handler(type, value, tb):
logger.tra... | en | 0.312087 | # Install exception handler # if run by pyinstaller executable, frozen attr will be true # _MEIPASS contain temp pyinstaller dir # name, dir # Новый экземпляр QApplication | 2.168869 | 2 |
python/models/bilstm5.py | mega002/DANN-MNLI | 0 | 6633092 | import tensorflow as tf
from util import blocks
from util.flip_gradient import flip_gradient
class MyModel(object):
def __init__(self, seq_length, emb_dim, hidden_dim, embeddings, emb_train):
## Define hyperparameters
self.embedding_dim = emb_dim
self.dim = hidden_dim
self.sequence_... | import tensorflow as tf
from util import blocks
from util.flip_gradient import flip_gradient
class MyModel(object):
def __init__(self, seq_length, emb_dim, hidden_dim, embeddings, emb_train):
## Define hyperparameters
self.embedding_dim = emb_dim
self.dim = hidden_dim
self.sequence_... | en | 0.443752 | ## Define hyperparameters ## Define the placeholders ### Feature extractor ## Fucntion for embedding lookup and dropout at embedding layer # Get lengths of unpadded sentences ### BiLSTM layer ### #premise_final = blocks.last_output(premise_bi, prem_seq_lengths) #hypothesis_final = blocks.last_output(hypothesis_bi, hyp... | 2.37166 | 2 |
lib/spack/spack/cmd/unuse.py | HaochengLIU/spack | 1 | 6633093 | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import argparse
from spack.cmd.common import print_module_placeholder_help
description = "remove package from environment... | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import argparse
from spack.cmd.common import print_module_placeholder_help
description = "remove package from environment... | en | 0.743565 | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) Parser is only constructed so that this prints a nice help message with -h. | 1.820526 | 2 |
mmtf/codecs/__init__.py | jonwedell/mmtf-python | 36 | 6633094 | from .default_codec import decode_array,encode_array | from .default_codec import decode_array,encode_array | none | 1 | 1.083258 | 1 | |
feed_fwd_NN_from_scratch.py | Prashant47/deep-learning-elu | 0 | 6633095 | <reponame>Prashant47/deep-learning-elu<filename>feed_fwd_NN_from_scratch.py
class Feed_fwd_nn:
n_hidden_layers = 0
n_hidden_diamensions = []
n_input = 0
n_output = 0
weights = []
biases = []
diamensions = []
activations = []
delta_weights = []
delta_biases = []
def... | class Feed_fwd_nn:
n_hidden_layers = 0
n_hidden_diamensions = []
n_input = 0
n_output = 0
weights = []
biases = []
diamensions = []
activations = []
delta_weights = []
delta_biases = []
def __init__(self, n_input, n_output, n_hidden_diamensions):
np.random.s... | en | 0.613174 | ## forward propagation ## forward propagation #print self.activations # learning rate, | 2.325847 | 2 |
gramex/http.py | NAnnamalai/gramex | 130 | 6633096 | <filename>gramex/http.py<gh_stars>100-1000
'''
Standard (and some non-standard) HTTP codes.
We don't use six.moves.http_client because it doesn't contain codes like:
CLIENT_TIMEOUT, RATE_LIMITED, TOO_MANY_REQUESTS. Here, we add them all.
'''
# status codes
# informational
CONTINUE = 100
SWITCHING_PROTOCOLS = 101
PROCE... | <filename>gramex/http.py<gh_stars>100-1000
'''
Standard (and some non-standard) HTTP codes.
We don't use six.moves.http_client because it doesn't contain codes like:
CLIENT_TIMEOUT, RATE_LIMITED, TOO_MANY_REQUESTS. Here, we add them all.
'''
# status codes
# informational
CONTINUE = 100
SWITCHING_PROTOCOLS = 101
PROCE... | en | 0.734227 | Standard (and some non-standard) HTTP codes. We don't use six.moves.http_client because it doesn't contain codes like: CLIENT_TIMEOUT, RATE_LIMITED, TOO_MANY_REQUESTS. Here, we add them all. # status codes # informational # successful # redirection # client error # server error | 1.471764 | 1 |
tests/test_launch_game.py | deterok/galaxy-integrations-python-api | 1,165 | 6633097 | <reponame>deterok/galaxy-integrations-python-api
import pytest
from galaxy.unittest.mock import async_return_value
from tests import create_message
@pytest.mark.asyncio
async def test_success(plugin, read):
request = {
"jsonrpc": "2.0",
"method": "launch_game",
"params": {
"g... | import pytest
from galaxy.unittest.mock import async_return_value
from tests import create_message
@pytest.mark.asyncio
async def test_success(plugin, read):
request = {
"jsonrpc": "2.0",
"method": "launch_game",
"params": {
"game_id": "3"
}
}
read.side_effec... | none | 1 | 2.204856 | 2 | |
changelog.py | Sheyin/Lurky | 0 | 6633098 | # Experimental bit to use requests module to read lurky's own changelog (from Github)
# Example code from requests (python module)
import requests
r = requests.get('https://api.github.com/user', auth=('user', 'pass'))
print(r.status_code)
# Should read "200" if successful
print(r.headers['content-type'])
# Should read... | # Experimental bit to use requests module to read lurky's own changelog (from Github)
# Example code from requests (python module)
import requests
r = requests.get('https://api.github.com/user', auth=('user', 'pass'))
print(r.status_code)
# Should read "200" if successful
print(r.headers['content-type'])
# Should read... | en | 0.713661 | # Experimental bit to use requests module to read lurky's own changelog (from Github) # Example code from requests (python module) # Should read "200" if successful # Should read: 'application/json; charset=utf8' # Should read: 'utf-8' # Should read: u'{"type":"User"...' # Should read: {u'private_gists': 419, u'total_p... | 2.36602 | 2 |
tilapia/lib/provider/exceptions.py | huazhouwang/python_multichain_wallet | 2 | 6633099 | <gh_stars>1-10
from typing import Any
class TransactionNotFound(Exception):
def __init__(self, txid: str):
super(TransactionNotFound, self).__init__(repr(txid))
self.txid = txid
class NoAvailableClient(Exception):
def __init__(self, chain_code: str, candidates: list, instance_required: Any):... | from typing import Any
class TransactionNotFound(Exception):
def __init__(self, txid: str):
super(TransactionNotFound, self).__init__(repr(txid))
self.txid = txid
class NoAvailableClient(Exception):
def __init__(self, chain_code: str, candidates: list, instance_required: Any):
super(... | none | 1 | 2.699286 | 3 | |
alipay/aop/api/domain/AlipayOpenSmsgDataSetModel.py | snowxmas/alipay-sdk-python-all | 213 | 6633100 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenSmsgDataSetModel(object):
def __init__(self):
self._paramone = None
self._paramtwo = None
@property
def paramone(self):
return self._paramone
@para... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenSmsgDataSetModel(object):
def __init__(self):
self._paramone = None
self._paramtwo = None
@property
def paramone(self):
return self._paramone
@para... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.276577 | 2 |
app_simulator/models/event.py | nicetester/newmonkey_tab | 0 | 6633101 | # -*- coding: UTF-8 -*-
class EventType(object):
CLICK = 'click'
class EventHandler(object):
def __init__(self, func, callback=None, *args, **kwargs):
self.func = func
self.callback = callback
self.args = args
self.kwargs = kwargs
def __str__(self):
return '%s' %... | # -*- coding: UTF-8 -*-
class EventType(object):
CLICK = 'click'
class EventHandler(object):
def __init__(self, func, callback=None, *args, **kwargs):
self.func = func
self.callback = callback
self.args = args
self.kwargs = kwargs
def __str__(self):
return '%s' %... | en | 0.222803 | # -*- coding: UTF-8 -*- | 2.676008 | 3 |
tests/reader/test_list_reader.py | ThisIsNima/dwetl | 1 | 6633102 | <gh_stars>1-10
import unittest
from dwetl.reader.list_reader import ListReader
class TestListReader(unittest.TestCase):
def test_simple_array(self):
array = [
'Line 1',
'Line 2'
]
reader = ListReader(array)
self.assertEqual(array[0], next(iter(reader)))
... | import unittest
from dwetl.reader.list_reader import ListReader
class TestListReader(unittest.TestCase):
def test_simple_array(self):
array = [
'Line 1',
'Line 2'
]
reader = ListReader(array)
self.assertEqual(array[0], next(iter(reader)))
self.asser... | none | 1 | 2.809943 | 3 | |
tests/components/lg_ess/__init__.py | gluap/home-assistant | 0 | 6633103 | """Tests for the LG ESS integration."""
| """Tests for the LG ESS integration."""
| en | 0.808366 | Tests for the LG ESS integration. | 0.964019 | 1 |
src/_dependencies/replace.py | nicoddemus/dependencies | 0 | 6633104 | from _dependencies.attributes import Attributes
from _dependencies.spec import make_dependency_spec
def deep_replace_dependency(injector, current_attr, replace):
spec = make_dependency_spec(current_attr, replace.dependency)
marker, attribute, args, have_defaults = spec
attribute = Attributes(attribute, r... | from _dependencies.attributes import Attributes
from _dependencies.spec import make_dependency_spec
def deep_replace_dependency(injector, current_attr, replace):
spec = make_dependency_spec(current_attr, replace.dependency)
marker, attribute, args, have_defaults = spec
attribute = Attributes(attribute, r... | none | 1 | 2.15317 | 2 | |
src/cookierec.py | Triballian/ordmon | 0 | 6633105 | <gh_stars>0
'''
Created on Mar 27, 2016
andy mckay crecipe http://code.activestate.com/recipes/80443/
@author: Noe
'''
from string import lower, find
import re, os, glob
import win32api, win32con
def _getLocation():
''' Looks through the registry to find the current users Cookie folder. This is the folder IE uses... | '''
Created on Mar 27, 2016
andy mckay crecipe http://code.activestate.com/recipes/80443/
@author: Noe
'''
from string import lower, find
import re, os, glob
import win32api, win32con
def _getLocation():
''' Looks through the registry to find the current users Cookie folder. This is the folder IE uses. '''
ke... | en | 0.845259 | Created on Mar 27, 2016 andy mckay crecipe http://code.activestate.com/recipes/80443/ @author: Noe Looks through the registry to find the current users Cookie folder. This is the folder IE uses. Rummages through all the files in the cookie folder, and returns only the ones whose file name, contains name. Name can ... | 2.774101 | 3 |
api_handler/xml_soccer.py | clwatkins/fpl_fun | 0 | 6633106 | """Reconstructs a football season fixture by fixture, outputting the table as it stood for every event.
Uses the football data API to provide raw match data.
Documentation here: http://www.xmlsoccer.com/FootballData.asmx
Key values:
EPL:
UEFA Champions League:
FA Cup:
FA Community Shield:
Get competitions: http://a... | """Reconstructs a football season fixture by fixture, outputting the table as it stood for every event.
Uses the football data API to provide raw match data.
Documentation here: http://www.xmlsoccer.com/FootballData.asmx
Key values:
EPL:
UEFA Champions League:
FA Cup:
FA Community Shield:
Get competitions: http://a... | en | 0.813287 | Reconstructs a football season fixture by fixture, outputting the table as it stood for every event. Uses the football data API to provide raw match data. Documentation here: http://www.xmlsoccer.com/FootballData.asmx Key values: EPL: UEFA Champions League: FA Cup: FA Community Shield: Get competitions: http://api.... | 3.4146 | 3 |
kwargs.py | taccisum/py_base_learn | 0 | 6633107 | <reponame>taccisum/py_base_learn<gh_stars>0
#coding=utf-8
print '使用kwargs定义一个字典初始化函数'
def dict_init(**kwargs):
return kwargs
print '初始化一个字典', dict_init(a=1, b=2, c='3')
| #coding=utf-8
print '使用kwargs定义一个字典初始化函数'
def dict_init(**kwargs):
return kwargs
print '初始化一个字典', dict_init(a=1, b=2, c='3') | en | 0.655248 | #coding=utf-8 | 2.708512 | 3 |
gtk3/intro/intro-widget.py | RobertoRosa7/python | 0 | 6633108 | <filename>gtk3/intro/intro-widget.py<gh_stars>0
# -*- coding: utf-8 -*-
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
default_size = {'width': 320, 'height': 568}
class Window(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Window")
self.set_default_size(def... | <filename>gtk3/intro/intro-widget.py<gh_stars>0
# -*- coding: utf-8 -*-
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
default_size = {'width': 320, 'height': 568}
class Window(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Window")
self.set_default_size(def... | en | 0.243742 | # -*- coding: utf-8 -*- # # label.set_angle(50) # # label.set_halign(Gtk.Align.START) # print(dir(Gtk.Align)) # self.set_default_size(default_size['width'], default_size['height']) # var = AboutDialog() # var = AppChooserButton() | 2.772689 | 3 |
ingest-data-progs/ingest_cabi_data.py | georgetown-analytics/DC-Criminalistics | 0 | 6633109 | <reponame>georgetown-analytics/DC-Criminalistics
'''
Import Libraries
'''
import json
import pandas as pd
import requests
import sqlite3
'''
Pull CABI station locations from https://gbfs.capitalbikeshare.com/gbfs/en/station_information.json
'''
def cabiWebPull():
url = 'https://gbfs.capitalbikeshare.com/gbfs/en/st... | '''
Import Libraries
'''
import json
import pandas as pd
import requests
import sqlite3
'''
Pull CABI station locations from https://gbfs.capitalbikeshare.com/gbfs/en/station_information.json
'''
def cabiWebPull():
url = 'https://gbfs.capitalbikeshare.com/gbfs/en/station_information.json'
response = requests.... | en | 0.829162 | Import Libraries Pull CABI station locations from https://gbfs.capitalbikeshare.com/gbfs/en/station_information.json Write to Database Table #Connect to DB table. #Drop table if exists. #Commit and close connection. The driver function. | 3.509795 | 4 |
aquecimento/python/B.py | Joao-Norberto/SBC-XXV-maratona-de-progrmacao | 0 | 6633110 | #retorna o fatorial de um número
def fatorial(n):
fat = 1
for i in range(n, 1, -1):
fat = fat * i
return fat
#retorna o fatorial mais próximo de um número
def fatorial_min(n):
X = int(1)
while fatorial(X) <= N:
X = X + 1
return X - 1
N = int(input())
qtd_fatoriais = int(0)
w... | #retorna o fatorial de um número
def fatorial(n):
fat = 1
for i in range(n, 1, -1):
fat = fat * i
return fat
#retorna o fatorial mais próximo de um número
def fatorial_min(n):
X = int(1)
while fatorial(X) <= N:
X = X + 1
return X - 1
N = int(input())
qtd_fatoriais = int(0)
w... | pt | 0.92793 | #retorna o fatorial de um número #retorna o fatorial mais próximo de um número | 3.829415 | 4 |
bamboo/common_python/test_tools.py | jychoi-hpc/lbann | 0 | 6633111 | <reponame>jychoi-hpc/lbann
import pytest
import subprocess
import tools
# This test file isn't in a directory to be run from Bamboo
# Run locally with python -m pytest -s
d = dict(
executable='exe',
num_nodes=20,
partition='pdebug',
time_limit=30,
num_processes=40,
dir_name='dir',
data_fi... | import pytest
import subprocess
import tools
# This test file isn't in a directory to be run from Bamboo
# Run locally with python -m pytest -s
d = dict(
executable='exe',
num_nodes=20,
partition='pdebug',
time_limit=30,
num_processes=40,
dir_name='dir',
data_filedir_default='lscratchh/fi... | en | 0.378049 | # This test file isn't in a directory to be run from Bamboo # Run locally with python -m pytest -s # Test error cases ############################################################ | 1.765574 | 2 |
index_select_assign/Conditional_Selection_2/Conditional_selection.py | CodeXfull/Pandas | 0 | 6633112 | import pandas as pd
base = pd.read_csv("./index_select_assign/access_data_1/census.csv")
# print(base.marital_status)
print(base.education == ' Bachelors') # True/False para o resultado
#Usando o ==
print(base.loc[base.marital_status == 'Divorced'])
print(base.loc[base.native_country == ' ?'])
#Usando o &
print((... | import pandas as pd
base = pd.read_csv("./index_select_assign/access_data_1/census.csv")
# print(base.marital_status)
print(base.education == ' Bachelors') # True/False para o resultado
#Usando o ==
print(base.loc[base.marital_status == 'Divorced'])
print(base.loc[base.native_country == ' ?'])
#Usando o &
print((... | pt | 0.733948 | # print(base.marital_status) # True/False para o resultado #Usando o == #Usando o & # substituindo o loop e usando o | | 3.760998 | 4 |
ingestors/support/pdf.py | simonwoerpel/ingest-file | 23 | 6633113 | <reponame>simonwoerpel/ingest-file<filename>ingestors/support/pdf.py
import uuid
from pdflib import Document
from followthemoney import model
from normality import collapse_spaces # noqa
from ingestors.support.ocr import OCRSupport
from ingestors.support.convert import DocumentConvertSupport
class PDFSupport(Docume... | import uuid
from pdflib import Document
from followthemoney import model
from normality import collapse_spaces # noqa
from ingestors.support.ocr import OCRSupport
from ingestors.support.convert import DocumentConvertSupport
class PDFSupport(DocumentConvertSupport, OCRSupport):
"""Provides helpers for PDF file c... | en | 0.623401 | # noqa Provides helpers for PDF file context extraction. Extract pages and page text from a PDF file. Extract the contents of a single PDF page, using OCR if need be. | 2.677114 | 3 |
gym_gridverse/representations/state_representations.py | DavidSlayback/gym-gridverse | 6 | 6633114 | from typing import Dict
import numpy as np
from gym_gridverse.debugging import gv_debug
from gym_gridverse.representations.representation import (
StateRepresentation,
default_convert,
default_representation_space,
no_overlap_convert,
no_overlap_representation_space,
)
from gym_gridverse.represent... | from typing import Dict
import numpy as np
from gym_gridverse.debugging import gv_debug
from gym_gridverse.representations.representation import (
StateRepresentation,
default_convert,
default_representation_space,
no_overlap_convert,
no_overlap_representation_space,
)
from gym_gridverse.represent... | en | 0.718417 | The default representation for state Simply returns the state as indices. See :func:`gym_gridverse.representations.representation.default_representation_space` and :func:`gym_gridverse.representations.representation.default_convert` for more information Representation that ensures that the numbers repr... | 2.569149 | 3 |
src/collectors/ip/test/testip.py | hermdog/Diamond | 1,795 | 6633115 | #!/usr/bin/env python
# coding=utf-8
###############################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
try:
from cStringIO import StringIO
except ImportErro... | #!/usr/bin/env python
# coding=utf-8
###############################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
try:
from cStringIO import StringIO
except ImportErro... | de | 0.78886 | #!/usr/bin/env python # coding=utf-8 ############################################################################### ############################################################################### Ip: A B C Ip: 0 0 0 Ip: A B C Ip: 0 1 2 ############################################################################### | 2.119726 | 2 |
utils/misc/current_user.py | DNL-inc/bit | 1 | 6633116 | def get_current_user():
def decorator(func):
setattr(func, 'get_current_user', True)
return func
return decorator | def get_current_user():
def decorator(func):
setattr(func, 'get_current_user', True)
return func
return decorator | none | 1 | 2.694659 | 3 | |
punky_gibbon/setup.py | SVilgelm/CloudFerry | 6 | 6633117 | # Copyright (c) 2016 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | # Copyright (c) 2016 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | en | 0.836478 | # Copyright (c) 2016 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so... | 1.124595 | 1 |
calculadora.py | matheus770/Calculadora-python | 0 | 6633118 | <reponame>matheus770/Calculadora-python
n1 = float(input("Digite o primeiro numero: "))
n2 = float(input("Digite o segundo numero: "))
op = int(input("Digite 1 - Soma ou 2 - Subtração: "))
if(op == 1):
soma = n1 + n2
print(f"{n1} + {n2} = {soma}")
elif(op == 2):
sub = n1 - n2
print(f"{n1} ... | n1 = float(input("Digite o primeiro numero: "))
n2 = float(input("Digite o segundo numero: "))
op = int(input("Digite 1 - Soma ou 2 - Subtração: "))
if(op == 1):
soma = n1 + n2
print(f"{n1} + {n2} = {soma}")
elif(op == 2):
sub = n1 - n2
print(f"{n1} - {n2} = {sub}")
else:
print("Er... | none | 1 | 3.811934 | 4 | |
src/polytopes/example_curved_polychora.py | timgates42/pywonderland | 0 | 6633119 | # -*- coding: utf-8 -*-
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Render curved 4d polychoron examples
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright (c) 2018 by <NAME>.
"""
import os
import subprocess
from fractions import Fraction
from polytopes.models import Polychora
from polytopes.povray import pov_index_array1d... | # -*- coding: utf-8 -*-
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Render curved 4d polychoron examples
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright (c) 2018 by <NAME>.
"""
import os
import subprocess
from fractions import Fraction
from polytopes.models import Polychora
from polytopes.povray import pov_index_array1d... | en | 0.650177 | # -*- coding: utf-8 -*- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Render curved 4d polychoron examples ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright (c) 2018 by <NAME>. # directory to save the frames # POV-Ray exe binary # the main scene file # image size in pixels # number of frames # between 0-11 # between 1-9 # lower ... | 2.409191 | 2 |
threeML/test/test_fits_file.py | Husky22/threeML | 0 | 6633120 |
from threeML.io.fits_file import FITSExtension, FITSFile
import numpy as np
import astropy.io.fits as fits
import pytest
class DUMMYEXT(FITSExtension):
def __init__(self, test_value):
data_list = [('TEST_VALUE', test_value)]
super(DUMMYEXT, self).__init__(tuple(data_list), (('EXTNAME', 'TEST'... |
from threeML.io.fits_file import FITSExtension, FITSFile
import numpy as np
import astropy.io.fits as fits
import pytest
class DUMMYEXT(FITSExtension):
def __init__(self, test_value):
data_list = [('TEST_VALUE', test_value)]
super(DUMMYEXT, self).__init__(tuple(data_list), (('EXTNAME', 'TEST'... | none | 1 | 2.067719 | 2 | |
src/repeated_string_match_686.py | xiezhq-hermann/LeetCode-in-Python | 3 | 6633121 | class Solution(object):
def repeatedStringMatch(self, A, B):
"""
:type A: str
:type B: str
:rtype: int
"""
base = (len(B)-1)//len(A) + 1
for i in range(base, base+2):
if B in A*i:
return i
else:
return -1
| class Solution(object):
def repeatedStringMatch(self, A, B):
"""
:type A: str
:type B: str
:rtype: int
"""
base = (len(B)-1)//len(A) + 1
for i in range(base, base+2):
if B in A*i:
return i
else:
return -1
| en | 0.434094 | :type A: str :type B: str :rtype: int | 3.476163 | 3 |
cime/synthesis.py | iro-upgto/cime | 0 | 6633122 | from sympy import *
# ~ from sympy.matrices import *
from sympy.geometry import *
import numpy as np
import matplotlib.pyplot as plt
def two_positions(s1,s2):
pass
if __name__=="__main__":
# ~ s1 = Segment
# ~ s2 = (1,0)
two_positions()
| from sympy import *
# ~ from sympy.matrices import *
from sympy.geometry import *
import numpy as np
import matplotlib.pyplot as plt
def two_positions(s1,s2):
pass
if __name__=="__main__":
# ~ s1 = Segment
# ~ s2 = (1,0)
two_positions()
| en | 0.679928 | # ~ from sympy.matrices import * # ~ s1 = Segment # ~ s2 = (1,0) | 2.403321 | 2 |
tests/test_user.py | eshta/authentek | 0 | 6633123 | <filename>tests/test_user.py
from flask import url_for
from authentek.database.models import User
def test_get_user(client, db, user, admin_headers):
# test 404
user_url = url_for('api.user_by_id', user_id="100000")
rep = client.get(user_url, headers=admin_headers)
assert rep.status_code == 404
d... | <filename>tests/test_user.py
from flask import url_for
from authentek.database.models import User
def test_get_user(client, db, user, admin_headers):
# test 404
user_url = url_for('api.user_by_id', user_id="100000")
rep = client.get(user_url, headers=admin_headers)
assert rep.status_code == 404
d... | en | 0.115415 | # test 404 # test get_user # test 404 # test update user # test 404 # test get_user # test bad data | 2.573247 | 3 |
tests/test_unit/test_pals.py | Cray-HPE/craycli | 1 | 6633124 | # MIT License
#
# (C) Copyright [2020-2022] Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the... | # MIT License
#
# (C) Copyright [2020-2022] Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the... | en | 0.764823 | # MIT License # # (C) Copyright [2020-2022] Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the... | 1.506318 | 2 |
boids/Flock.py | stiebels/boids | 0 | 6633125 | import random
import numpy as np
from .Boid import Boid
'''
Implements Flock as controlling instance of each Boid
'''
class Flock(object):
# Flock is controlling instances of Boid
def __init__(self, size, fly_middle_strength, fly_away_limit, speed_match_strength, distance_limit,
x_coord_range... | import random
import numpy as np
from .Boid import Boid
'''
Implements Flock as controlling instance of each Boid
'''
class Flock(object):
# Flock is controlling instances of Boid
def __init__(self, size, fly_middle_strength, fly_away_limit, speed_match_strength, distance_limit,
x_coord_range... | en | 0.8357 | Implements Flock as controlling instance of each Boid # Flock is controlling instances of Boid # Creates Boid objects # Invokes computation of new position of each Boid | 2.951404 | 3 |
users/models/__init__.py | recentfahim/smartbusinessbd | 0 | 6633126 | <gh_stars>0
from .contact import Contact
from .user import User
from .payments import Payment
from .subscription import Subscription
from .temp_data import TempData
| from .contact import Contact
from .user import User
from .payments import Payment
from .subscription import Subscription
from .temp_data import TempData | none | 1 | 1.076764 | 1 | |
settings.py | iag-geo/concord | 0 | 6633127 | # takes the command line parameters and creates a dictionary of setting_dict
import os
import argparse
import platform
import psycopg2
import sys
from datetime import datetime
# get latest Geoscape release version as YYYYMM, as of the date provided, as well as the prev. version 3 months prior
def get_geoscape_versi... | # takes the command line parameters and creates a dictionary of setting_dict
import os
import argparse
import platform
import psycopg2
import sys
from datetime import datetime
# get latest Geoscape release version as YYYYMM, as of the date provided, as well as the prev. version 3 months prior
def get_geoscape_versi... | en | 0.61736 | # takes the command line parameters and creates a dictionary of setting_dict # get latest Geoscape release version as YYYYMM, as of the date provided, as well as the prev. version 3 months prior # get python, psycopg2 and OS versions # get the command line arguments for the script # PG Options # schema names for the ra... | 3.090209 | 3 |
transitions_kpi.py | regisb/repo-tools | 23 | 6633128 | <filename>transitions_kpi.py
#!/usr/bin/env python
"""
Scrapes and parses information from JIRA's transition states.
Runs the JIRA spider, then parses the output states.json
file to obtain KPI information.
See https://openedx.atlassian.net/wiki/display/OPEN/Tracking+edX+Commitment+To+OSPRs
"""
from collections import... | <filename>transitions_kpi.py
#!/usr/bin/env python
"""
Scrapes and parses information from JIRA's transition states.
Runs the JIRA spider, then parses the output states.json
file to obtain KPI information.
See https://openedx.atlassian.net/wiki/display/OPEN/Tracking+edX+Commitment+To+OSPRs
"""
from collections import... | en | 0.901261 | #!/usr/bin/env python Scrapes and parses information from JIRA's transition states. Runs the JIRA spider, then parses the output states.json file to obtain KPI information. See https://openedx.atlassian.net/wiki/display/OPEN/Tracking+edX+Commitment+To+OSPRs Re-scrapes jira into states.json # Delete content of states.... | 2.784524 | 3 |
reviews/views.py | n3trob3/nimrodage | 0 | 6633129 | from django.shortcuts import render
from django.views.generic import ListView
from .models import Reviews
from Home.models import Service, Industry
# Create your views here.
class ReviewPage(ListView):
model = Reviews
context_object_name = 'reviews'
template_name = 'reviews/reviews.html'
def get_context_... | from django.shortcuts import render
from django.views.generic import ListView
from .models import Reviews
from Home.models import Service, Industry
# Create your views here.
class ReviewPage(ListView):
model = Reviews
context_object_name = 'reviews'
template_name = 'reviews/reviews.html'
def get_context_... | en | 0.968116 | # Create your views here. | 1.959507 | 2 |
utils/help.py | JakeWasChosen/edoC | 1 | 6633130 | <gh_stars>1-10
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright (c) 2021. <NAME> +
# All rights reserved. +
# This f... | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright (c) 2021. <NAME> +
# All rights reserved. +
# This file is part of ... | en | 0.589401 | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Copyright (c) 2021. <NAME> + # All rights reserved. + # This file is part of ... | 2.342016 | 2 |
tmt/steps/provision/vagrant.py | optak/tmt | 0 | 6633131 | # coding: utf-8
""" Provision Step Vagrnat Class """
import tmt
import subprocess
import os
import re
from tmt.steps.provision.base import ProvisionBase
from tmt.utils import ConvertError, SpecificationError, GeneralError
from click import echo
from shlex import quote
from urllib.parse import urlparse
# DATA[*]:
... | # coding: utf-8
""" Provision Step Vagrnat Class """
import tmt
import subprocess
import os
import re
from tmt.steps.provision.base import ProvisionBase
from tmt.utils import ConvertError, SpecificationError, GeneralError
from click import echo
from shlex import quote
from urllib.parse import urlparse
# DATA[*]:
... | en | 0.614309 | # coding: utf-8 Provision Step Vagrnat Class # DATA[*]: # HOW = libvirt|virtual|docker|container|vagrant|... # provider, in Vagrant's terminilogy # # IMAGE = URI|NAME # NAME is for Vagrant or other HOW, passed directly # URI can be path to BOX, QCOW2 or Vagrantfile f.e. # # BOX = Set a BOX... | 2.116718 | 2 |
xlib/avecl/_internal/op/transpose.py | jkennedyvz/DeepFaceLive | 3 | 6633132 | import numpy as np
from ..AAxes import AAxes
from ..AShape import AShape
from ..backend import Kernel
from ..HKernel import HKernel
from ..info import TransposeInfo
from ..SCacheton import SCacheton
from ..Tensor import Tensor
def transpose(input_t : Tensor, axes_order, op_text=None, dtype : np.dtype = None, output_t... | import numpy as np
from ..AAxes import AAxes
from ..AShape import AShape
from ..backend import Kernel
from ..HKernel import HKernel
from ..info import TransposeInfo
from ..SCacheton import SCacheton
from ..Tensor import Tensor
def transpose(input_t : Tensor, axes_order, op_text=None, dtype : np.dtype = None, output_t... | en | 0.306141 | arguments: axes_order Int Iterable of ints None dtype cast to dtype op_text(None) optional op with value during transpose. 'O = I' output_t compute result to this Tensor. ... | 2.192755 | 2 |
lib/test_pca9685.py | Mario-Kart-Felix/oxygen | 1 | 6633133 | #!/sr/bin/env python
import time
from pca9685 import PCA9685
def main():
driver = PCA9685()
driver.set_pwm_freq(60)
time.sleep(3)
for i in range(300, 500, 5):
print(i)
driver.set_pwm(0, 0, i)
time.sleep(0.1)
for i in range(500, 299, -5):
print(i)
driver.set... | #!/sr/bin/env python
import time
from pca9685 import PCA9685
def main():
driver = PCA9685()
driver.set_pwm_freq(60)
time.sleep(3)
for i in range(300, 500, 5):
print(i)
driver.set_pwm(0, 0, i)
time.sleep(0.1)
for i in range(500, 299, -5):
print(i)
driver.set... | en | 0.19696 | #!/sr/bin/env python # driver.set_pwm(0, 0, 0) | 3.055096 | 3 |
ML_Chinahadoop/05/code/lesson/5.3.stat02.py | lsieun/learn-AI | 1 | 6633134 | # coding:utf-8
#
import numpy as np
from scipy import stats
def calc_statistics(x):
n = x.shape[0] # 样本个数
# 手动计算
m = 0
m2 = 0
m3 = 0
m4 = 0
for t in x:
m += t
m2 += t*t
m3 += t**3
m4 += t**4
m /= n
m2 /= n
m3 /= n
m4 /= n
mu = m
si... | # coding:utf-8
#
import numpy as np
from scipy import stats
def calc_statistics(x):
n = x.shape[0] # 样本个数
# 手动计算
m = 0
m2 = 0
m3 = 0
m4 = 0
for t in x:
m += t
m2 += t*t
m3 += t**3
m4 += t**4
m /= n
m2 /= n
m3 /= n
m4 /= n
mu = m
si... | zh | 0.956131 | # coding:utf-8 # # 样本个数 # 手动计算 # 使用系统函数验证 | 3.48782 | 3 |
sabnzbd/lang.py | jxyzn/sabnzbd | 0 | 6633135 | #!/usr/bin/python3 -OO
# -*- coding: utf-8 -*-
# Copyright 2011-2021 The SABnzbd-Team <<EMAIL>>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | #!/usr/bin/python3 -OO
# -*- coding: utf-8 -*-
# Copyright 2011-2021 The SABnzbd-Team <<EMAIL>>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your o... | en | 0.76007 | #!/usr/bin/python3 -OO # -*- coding: utf-8 -*- # Copyright 2011-2021 The SABnzbd-Team <<EMAIL>> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your o... | 1.846977 | 2 |
app/urls.py | Hikasgai/webServicesTest | 0 | 6633136 | from django.conf.urls import include, url
from django.contrib.auth.decorators import login_required
from . import views
urlpatterns = [
url(r'^$', views.index),
url(r'^calendarioanual$', views.calendarioanual),
url(r'^horario$', views.horarioAsignaturas),
url(r'^getAsignaturas$', views.getAsignaturas)... | from django.conf.urls import include, url
from django.contrib.auth.decorators import login_required
from . import views
urlpatterns = [
url(r'^$', views.index),
url(r'^calendarioanual$', views.calendarioanual),
url(r'^horario$', views.horarioAsignaturas),
url(r'^getAsignaturas$', views.getAsignaturas)... | none | 1 | 1.686801 | 2 | |
2021/day_6/part_2.py | jcm300/advent_of_code | 1 | 6633137 | <reponame>jcm300/advent_of_code<gh_stars>1-10
import os
import re
import sys
import multiprocessing
from functools import reduce
# Read arguments
if len(sys.argv) != 2:
raise ValueError('Please provide a filename input')
filename = sys.argv[1]
# Read file
file_data = open(os.getcwd() + '/' + filename, 'r')
#
# ... | import os
import re
import sys
import multiprocessing
from functools import reduce
# Read arguments
if len(sys.argv) != 2:
raise ValueError('Please provide a filename input')
filename = sys.argv[1]
# Read file
file_data = open(os.getcwd() + '/' + filename, 'r')
#
# Parse file
#
text = file_data.read().replace('... | en | 0.607272 | # Read arguments # Read file # # Parse file # # # Get answer # | 3.29483 | 3 |
app.py | tbotnz/flask-AdminLTE | 6 | 6633138 | from flask import Flask, render_template, redirect, url_for, request, json
app = Flask(__name__)
@app.route("/starter")
def starter():
return render_template("starter.html")
@app.route("/")
@app.route("/index")
def index():
return render_template("index.html")
@app.route("/index2")
def index_two():
r... | from flask import Flask, render_template, redirect, url_for, request, json
app = Flask(__name__)
@app.route("/starter")
def starter():
return render_template("starter.html")
@app.route("/")
@app.route("/index")
def index():
return render_template("index.html")
@app.route("/index2")
def index_two():
r... | none | 1 | 2.7288 | 3 | |
patch-host.py | dwbfox/patch-hosts | 0 | 6633139 | <gh_stars>0
import urllib.request as requests
import shutil
import os
hosts_dir = 'C:\\Windows\\System32\\drivers\\etc\\'
hosts_download = 'http://winhelp2002.mvps.org/hosts.txt'
print('Download updated hosts file...');
with open('hosts.data', 'wbc') as hfile:
hfile.write(requests.urlopen(hosts_downl... | import urllib.request as requests
import shutil
import os
hosts_dir = 'C:\\Windows\\System32\\drivers\\etc\\'
hosts_download = 'http://winhelp2002.mvps.org/hosts.txt'
print('Download updated hosts file...');
with open('hosts.data', 'wbc') as hfile:
hfile.write(requests.urlopen(hosts_download).read())... | none | 1 | 2.829788 | 3 | |
apps/amcm/migrations/0061_auto_20220503_1309.py | agsneutron/asociacion_mexicana_cuarto_milla | 0 | 6633140 | <gh_stars>0
# Generated by Django 3.2.6 on 2022-05-03 18:09
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('amcm', '0060_auto_20220427_1856'),
]
operations = [
migrations.AddField(
... | # Generated by Django 3.2.6 on 2022-05-03 18:09
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('amcm', '0060_auto_20220427_1856'),
]
operations = [
migrations.AddField(
m... | en | 0.837247 | # Generated by Django 3.2.6 on 2022-05-03 18:09 | 1.713853 | 2 |
0751-0800/0771-JewelsAndStones/JewelsAndStones.py | Sun-Zhen/leetcode | 3 | 6633141 | <gh_stars>1-10
# -*- coding:utf-8 -*-
"""
@author: Alden
@email: <EMAIL>
@date: 2018/3/30
@version: 1.0.0.0
"""
class Solution(object):
def numJewelsInStones(self, J, S):
"""
:type J: str
:type S: str
:rtype: int
"""
res = 0
target_list = list()
for ... | # -*- coding:utf-8 -*-
"""
@author: Alden
@email: <EMAIL>
@date: 2018/3/30
@version: 1.0.0.0
"""
class Solution(object):
def numJewelsInStones(self, J, S):
"""
:type J: str
:type S: str
:rtype: int
"""
res = 0
target_list = list()
for tmp in J:
... | en | 0.288929 | # -*- coding:utf-8 -*- @author: Alden @email: <EMAIL> @date: 2018/3/30 @version: 1.0.0.0 :type J: str :type S: str :rtype: int | 3.657952 | 4 |
sparrow_kms.py | suramrit/sparrow | 15 | 6633142 | <filename>sparrow_kms.py<gh_stars>10-100
#!/usr/bin/env python
import boto3
import base64
import random
import json
from twython import Twython
# Credentials setup
# Loads in 'creds.json' values as a dictionary
with open('creds.json') as f:
credentials = json.loads(f.read())
def decrypt(ciphertext):
"""Decryp... | <filename>sparrow_kms.py<gh_stars>10-100
#!/usr/bin/env python
import boto3
import base64
import random
import json
from twython import Twython
# Credentials setup
# Loads in 'creds.json' values as a dictionary
with open('creds.json') as f:
credentials = json.loads(f.read())
def decrypt(ciphertext):
"""Decryp... | en | 0.601325 | #!/usr/bin/env python # Credentials setup # Loads in 'creds.json' values as a dictionary Decrypt ciphertext with KMS # Decrypts API keys and sets config values from the config file # Make sure this is loading KMS encrypted values in creds.json # or else you may see a TypeError: Incorrect padding error # Create the Twyt... | 2.790725 | 3 |
0000_students_work/2021tro/projection_local_gaussian.py | takuya-ki/wrs | 23 | 6633143 | <filename>0000_students_work/2021tro/projection_local_gaussian.py
import numpy as np
import modeling.geometric_model as gm
import modeling.collision_model as cm
import visualization.panda.world as wd
import basis.robot_math as rm
import math
from scipy.spatial import cKDTree
import vision.depth_camera.surface.gaussian_... | <filename>0000_students_work/2021tro/projection_local_gaussian.py
import numpy as np
import modeling.geometric_model as gm
import modeling.collision_model as cm
import visualization.panda.world as wd
import basis.robot_math as rm
import math
from scipy.spatial import cKDTree
import vision.depth_camera.surface.gaussian_... | en | 0.44875 | # gm.gen_frame().attach_to(base) # gm.gen_linesegs(line_segs).attach_to(base) # gm.gen_stick(spt, spt + pn_direction * 10, rgba=[0,1,0,1]).attach_to(base) # base.run() # p0 # p0 # p0 # gm.gen_linesegs(new_line_segs).attach_to(base) # for sec in [new_line_segs[0]]: # gm.gen_stick(spos=sec[0], epos=sec[1], rgba=[0, 0... | 2.08612 | 2 |
test/ext_rex.py | mawentao007/reading_grab | 0 | 6633144 | <gh_stars>0
# coding: utf-8
import re
from weblib.error import DataNotFound
import six
from test.util import build_grab
from test.util import BaseGrabTestCase
HTML = u"""
<head>
<title>фыва</title>
<meta http-equiv="Content-Type" content="text/html; charset=cp1251" />
</head>
<body>
<div id="bee">
... | # coding: utf-8
import re
from weblib.error import DataNotFound
import six
from test.util import build_grab
from test.util import BaseGrabTestCase
HTML = u"""
<head>
<title>фыва</title>
<meta http-equiv="Content-Type" content="text/html; charset=cp1251" />
</head>
<body>
<div id="bee">
<div class=... | en | 0.307757 | # coding: utf-8 <head> <title>фыва</title> <meta http-equiv="Content-Type" content="text/html; charset=cp1251" /> </head> <body> <div id="bee"> <div class="wrapper"> # russian LA <strong id="bee-strong">пче</strong><em id="bee-em">ла</em> </div> <script type="... | 2.365368 | 2 |
tests/inlineasm/asmblbx.py | sebastien-riou/micropython | 13,648 | 6633145 | <filename>tests/inlineasm/asmblbx.py
# test bl and bx instructions
@micropython.asm_thumb
def f(r0):
# jump over the internal functions
b(entry)
label(func1)
add(r0, 2)
bx(lr)
label(func2)
sub(r0, 1)
bx(lr)
label(entry)
bl(func1)
bl(func2)
print(f(0))
print(f(1))
| <filename>tests/inlineasm/asmblbx.py
# test bl and bx instructions
@micropython.asm_thumb
def f(r0):
# jump over the internal functions
b(entry)
label(func1)
add(r0, 2)
bx(lr)
label(func2)
sub(r0, 1)
bx(lr)
label(entry)
bl(func1)
bl(func2)
print(f(0))
print(f(1))
| en | 0.654669 | # test bl and bx instructions # jump over the internal functions | 2.289775 | 2 |
gfftk/compare.py | nextgenusfs/gfftk | 0 | 6633146 | <filename>gfftk/compare.py<gh_stars>0
import sys
from collections import defaultdict, OrderedDict
from natsort import natsorted
from itertools import product
import numpy as np
from .utils import zopen
from .gff import gff2dict
from .interlap import InterLap
from .consensus import getAED
def compare(args):
compar... | <filename>gfftk/compare.py<gh_stars>0
import sys
from collections import defaultdict, OrderedDict
from natsort import natsorted
from itertools import product
import numpy as np
from .utils import zopen
from .gff import gff2dict
from .interlap import InterLap
from .consensus import getAED
def compare(args):
compar... | en | 0.893692 | function to parse GFF3 file, construct scaffold/gene interlap dictionary and funannotate standard annotation dictionary # given funannotate dictionary, count up some general features takes a multiple transcripts and sums AED from lowest pairwise comparison and then calculates the average based on number of transcri... | 2.576159 | 3 |
api/app.py | UUDigitalHumanitieslab/historic-hebrew-dates | 1 | 6633147 | import os
import sys
import glob
import csv
import json
import traceback
from flask import Flask, jsonify, request
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from historic_hebrew_dates import create_parsers
app = Flask(__name__)
def pattern_path(lang, type):
path = os.path.j... | import os
import sys
import glob
import csv
import json
import traceback
from flask import Flask, jsonify, request
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from historic_hebrew_dates import create_parsers
app = Flask(__name__)
def pattern_path(lang, type):
path = os.path.j... | none | 1 | 2.923128 | 3 | |
ThirdAndFourthStage/retweet_collection.py | kamplus/FakeNewsSetGen | 1 | 6633148 | <gh_stars>1-10
import json
import logging
from twython import TwythonError, TwythonRateLimitError
from tweet_collection import Tweet
from util.TwythonConnector import TwythonConnector
from util.util import create_dir, Config, multiprocess_data_collection
from util.util import DataCollector
from util import Constants... | import json
import logging
from twython import TwythonError, TwythonRateLimitError
from tweet_collection import Tweet
from util.TwythonConnector import TwythonConnector
from util.util import create_dir, Config, multiprocess_data_collection
from util.util import DataCollector
from util import Constants
def dump_ret... | none | 1 | 2.362298 | 2 | |
moldesign/utils/callsigs.py | Autodesk/molecular-design-toolkit | 147 | 6633149 | from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()
# Copyright 2017 Autodesk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()
# Copyright 2017 Autodesk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | en | 0.669663 | # Copyright 2017 Autodesk Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing... | 1.958953 | 2 |
pyscripts/s13_pacman_reflector_hook.py | Trick-17/arch-installer | 9 | 6633150 | pacman_reflector_hook = """[Trigger]
Operation = Upgrade
Type = Package
Target = pacman-mirrorlist
[Action]
Description = Updating pacman-mirrorlist with reflector and removing pacnew...
When = PostTransaction
Depends = reflector
Exec = /usr/bin/env sh -c "reflector --latest 100 --sort rate --protocol https --save /et... | pacman_reflector_hook = """[Trigger]
Operation = Upgrade
Type = Package
Target = pacman-mirrorlist
[Action]
Description = Updating pacman-mirrorlist with reflector and removing pacnew...
When = PostTransaction
Depends = reflector
Exec = /usr/bin/env sh -c "reflector --latest 100 --sort rate --protocol https --save /et... | en | 0.518308 | [Trigger] Operation = Upgrade Type = Package Target = pacman-mirrorlist [Action] Description = Updating pacman-mirrorlist with reflector and removing pacnew... When = PostTransaction Depends = reflector Exec = /usr/bin/env sh -c "reflector --latest 100 --sort rate --protocol https --save /etc/pacman.d/mirrorlist; if [... | 2.072083 | 2 |