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
features/steps/ps_sdf_state_msg.py
PolySync/core-python-api
0
6621951
# WARNING: Auto-generated file. Any changes are subject to being overwritten # by setup.py build script. #!/usr/bin/python import time from behave import given from behave import when from behave import then from hamcrest import assert_that, equal_to try: import polysync.node as ps_node from polysync.data_mod...
# WARNING: Auto-generated file. Any changes are subject to being overwritten # by setup.py build script. #!/usr/bin/python import time from behave import given from behave import when from behave import then from hamcrest import assert_that, equal_to try: import polysync.node as ps_node from polysync.data_mod...
en
0.82422
# WARNING: Auto-generated file. Any changes are subject to being overwritten # by setup.py build script. #!/usr/bin/python
1.799874
2
Project/python/PySpy/sp1.py
RayleighChen/Improve
1
6621952
import urllib2 response = urllib2.urlopen("http://www.baidu.com") print response.read()
import urllib2 response = urllib2.urlopen("http://www.baidu.com") print response.read()
none
1
2.719876
3
maxima/src/maxima/share/pytranslate/cantorr.py
nilqed/spadlib
1
6621953
from pytranslate import * ######################### ### Cantorr2 Function ### ######################### def block17340(v): v = Stack({}, v) if ((v["x"] > 0) and (v["x"] <= (1 / 3))): v["ret"] = cantorr2((3 * v["x"]), (v["n"] + (-1))) if (((1 / 3) < v["x"]) and (v["x"] < (2 / 3))): v...
from pytranslate import * ######################### ### Cantorr2 Function ### ######################### def block17340(v): v = Stack({}, v) if ((v["x"] > 0) and (v["x"] <= (1 / 3))): v["ret"] = cantorr2((3 * v["x"]), (v["n"] + (-1))) if (((1 / 3) < v["x"]) and (v["x"] < (2 / 3))): v...
de
0.708855
######################### ### Cantorr2 Function ### ######################### ######################### ### Cantorri Function ### ######################### ######################### ### Cantorrd Function ### ######################### ######################## ## Cantorr_p Function ## ######################## ###########...
3.309628
3
cytoskeleton_analyser/plasma_membrane.py
vsukhor/cytoskeleton-analyser
0
6621954
<reponame>vsukhor/cytoskeleton-analyser # Copyright (c) 2021 <NAME>. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notice, ...
# Copyright (c) 2021 <NAME>. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the followin...
en
0.713039
# Copyright (c) 2021 <NAME>. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the followin...
1.408543
1
snooty/test_devhub.py
schmalliso/snooty-parser
0
6621955
<gh_stars>0 from pathlib import Path from typing import cast, Any, Dict, List from .types import BuildIdentifierSet, FileId, SerializableType from .parser import Project from .test_project import Backend from .util_test import check_ast_testing_string import pytest @pytest.fixture def backend() -> Backend: backen...
from pathlib import Path from typing import cast, Any, Dict, List from .types import BuildIdentifierSet, FileId, SerializableType from .parser import Project from .test_project import Backend from .util_test import check_ast_testing_string import pytest @pytest.fixture def backend() -> Backend: backend = Backend(...
en
0.675505
# Incorrectly formatted date is omitted <role name="doc" target="/path/to/article"></role> <literal><text>:doc:`/path/to/other/article`</text></literal> Test that page groups are correctly filtered and cleaned.
2.283867
2
neutronpy/crystal/tools.py
neutronpy/neutronpy
14
6621956
<reponame>neutronpy/neutronpy # -*- coding: utf-8 -*- import numpy as np def gram_schmidt(in_vecs, row_vecs=True, normalize=True): r""" """ if not row_vecs: in_vecs = in_vecs.T out_vecs = in_vecs[0:1, :] for i in range(1, in_vecs.shape[0]): proj = np.diag((in_vecs[i, :].dot(out_...
# -*- coding: utf-8 -*- import numpy as np def gram_schmidt(in_vecs, row_vecs=True, normalize=True): r""" """ if not row_vecs: in_vecs = in_vecs.T out_vecs = in_vecs[0:1, :] for i in range(1, in_vecs.shape[0]): proj = np.diag((in_vecs[i, :].dot(out_vecs.T) / np.linalg.norm(out_v...
en
0.769321
# -*- coding: utf-8 -*-
2.681219
3
DPS_Huijben2020/CIFAR10_MNIST/trainingUpdate_callback.py
IamHuijben/Deep-Probabilistic-Subsampling
12
6621957
""" ============================================================================= Eindhoven University of Technology ============================================================================== Source Name : trainingUpdate_callback.py Callback which displays the training graph for the t...
""" ============================================================================= Eindhoven University of Technology ============================================================================== Source Name : trainingUpdate_callback.py Callback which displays the training graph for the t...
en
0.622086
============================================================================= Eindhoven University of Technology ============================================================================== Source Name : trainingUpdate_callback.py Callback which displays the training graph for the train...
2.52243
3
8th_exercise/so.py
jerluebke/comp_phys
2
6621958
<reponame>jerluebke/comp_phys # -*- coding: utf-8 -*- """ harmonic oscillator with stochastic noise ddX + ω**2 X dt = μ dW as a 2nd order system: dX = V dt dV = μ dW - ω**2 * X dt note: euler's method causes the system to 'gain' energy (growing amplitudes) """ # TODO: # check/discuss results # ...
# -*- coding: utf-8 -*- """ harmonic oscillator with stochastic noise ddX + ω**2 X dt = μ dW as a 2nd order system: dX = V dt dV = μ dW - ω**2 * X dt note: euler's method causes the system to 'gain' energy (growing amplitudes) """ # TODO: # check/discuss results # compare with undisturbed and e...
en
0.820624
# -*- coding: utf-8 -*- harmonic oscillator with stochastic noise ddX + ω**2 X dt = μ dW as a 2nd order system: dX = V dt dV = μ dW - ω**2 * X dt note: euler's method causes the system to 'gain' energy (growing amplitudes) # TODO: # check/discuss results # compare with undisturbed and exact ana...
3.418534
3
restservice/endpoints.py
CenturyLink/ExpertDHCP
1
6621959
<reponame>CenturyLink/ExpertDHCP<filename>restservice/endpoints.py """ REST API endpoints written in Flask Only POST Calls for requests requiring data """ import sys import json import os from flask import request, Blueprint from flask_cors import cross_origin from restservice import LOGGER from restservice.con...
""" REST API endpoints written in Flask Only POST Calls for requests requiring data """ import sys import json import os from flask import request, Blueprint from flask_cors import cross_origin from restservice import LOGGER from restservice.config import SERVICE_CODE, REQUIRE_API_AUTHENTICATION from restservic...
en
0.679766
REST API endpoints written in Flask Only POST Calls for requests requiring data # Success # Bad request # None or bad credentials sent # General internal server error # API CODE FOR SERVICE 100 # RESPONSE CODES FOR SERVICE 900 - FastDHCP # Check for API keys if REQUIRE_API_AUTHENTICATION is enabled in # This functi...
2.73213
3
sctr/management/commands.py
candango/sctr
0
6621960
<filename>sctr/management/commands.py #!/usr/bin/env python # # Copyright 2021 <NAME> # # 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 # # Unl...
<filename>sctr/management/commands.py #!/usr/bin/env python # # Copyright 2021 <NAME> # # 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 # # Unl...
en
0.831548
#!/usr/bin/env python # # Copyright 2021 <NAME> # # 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 agre...
2.093004
2
util/file_util.py
zhangyi66ch/shuoGG1239p
12
6621961
<filename>util/file_util.py import sys import os import codecs import natsort def get_file_content(file_path): """ 读取文件, 暂时只支持utf8和gbk编码的文件, 自动去除BOM :param file_path: :return: str """ try: with open(file_path, encoding='utf-8') as f1: raw = f1.read() ...
<filename>util/file_util.py import sys import os import codecs import natsort def get_file_content(file_path): """ 读取文件, 暂时只支持utf8和gbk编码的文件, 自动去除BOM :param file_path: :return: str """ try: with open(file_path, encoding='utf-8') as f1: raw = f1.read() ...
zh
0.643314
读取文件, 暂时只支持utf8和gbk编码的文件, 自动去除BOM :param file_path: :return: str # 去掉BOM 写文件 :param file_path: str :param text: str :param encoding: str :return: None 写文件-append模式 :param file_path: str :param text: str :param encoding: str :return: None 当前目录下建一个文件夹 :param name: 文件...
2.972203
3
app/Http/Controllers/verifyParser.py
Alexamith23/conversor
0
6621962
#!/usr/bin/env python import json import sys # sanitize the argument def main(argv = sys.argv[1:]): var = "" it = 1 for i in argv: var += i if(it != len(argv)): var += " " it += 1 pass return var arguments = main() #args = json.dumps(arguments) # doubtful ...
#!/usr/bin/env python import json import sys # sanitize the argument def main(argv = sys.argv[1:]): var = "" it = 1 for i in argv: var += i if(it != len(argv)): var += " " it += 1 pass return var arguments = main() #args = json.dumps(arguments) # doubtful ...
en
0.274854
#!/usr/bin/env python # sanitize the argument #args = json.dumps(arguments) # doubtful operation # default sys.exit output inverted!
3.813977
4
13_error/eg_13_01_error_motion_calibration.py
byrobot-python/e_drone_examples
0
6621963
<reponame>byrobot-python/e_drone_examples # 드론 센서 캘리브레이션 요청 후 에러로 나타난 캘리브레이션 진행 상태를 화면에 표시 from time import sleep from e_drone.drone import * from e_drone.protocol import * def check_error(error, flag): if error & flag.value != 0: return True else: return False def event_error...
# 드론 센서 캘리브레이션 요청 후 에러로 나타난 캘리브레이션 진행 상태를 화면에 표시 from time import sleep from e_drone.drone import * from e_drone.protocol import * def check_error(error, flag): if error & flag.value != 0: return True else: return False def event_error(error): print("* eventError() / ...
ko
1.00007
# 드론 센서 캘리브레이션 요청 후 에러로 나타난 캘리브레이션 진행 상태를 화면에 표시 # 이벤트 핸들링 함수 등록
3.12324
3
graph_datasets/mazes/pmaze4.py
secnot/python-graph-datasets
0
6621964
<filename>graph_datasets/mazes/pmaze4.py # Perfect maze (tree) in a 55x55 grid # Nodes: 511 # Edges: 510 adjList = [ [18, 1], [21, 2, 0], [32, 1], [33, 4], [22, 3], [23, 6], [24, 5], [25], [9], [38, 8], [39, 11], [45, 12, 10], [40, 11], [14], [29, 15, 13], ...
<filename>graph_datasets/mazes/pmaze4.py # Perfect maze (tree) in a 55x55 grid # Nodes: 511 # Edges: 510 adjList = [ [18, 1], [21, 2, 0], [32, 1], [33, 4], [22, 3], [23, 6], [24, 5], [25], [9], [38, 8], [39, 11], [45, 12, 10], [40, 11], [14], [29, 15, 13], ...
en
0.407232
# Perfect maze (tree) in a 55x55 grid # Nodes: 511 # Edges: 510 # x coord, y coord
2.344962
2
apps/cars/migrations/0004_auto_20210623_1520.py
Marpop/demo-car-app
0
6621965
<gh_stars>0 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("cars", "0003_auto_20210623_1457"), ] operations = [ migrations.RemoveConstraint( model_name="car", name="unique name", ), migrations.Rena...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("cars", "0003_auto_20210623_1457"), ] operations = [ migrations.RemoveConstraint( model_name="car", name="unique name", ), migrations.RenameField( ...
none
1
1.874508
2
xebec/tests/test_template.py
gibsramen/xebec
1
6621966
import os def test_bake_project(cookies, data_paths): result = cookies.bake(extra_context={ "project_name": "example-benchmark", "feature_table_file": data_paths.table_file, "sample_metadata_file": data_paths.metadata_file, "phylogenetic_tree_file": data_paths.tree_file }) ...
import os def test_bake_project(cookies, data_paths): result = cookies.bake(extra_context={ "project_name": "example-benchmark", "feature_table_file": data_paths.table_file, "sample_metadata_file": data_paths.metadata_file, "phylogenetic_tree_file": data_paths.tree_file }) ...
none
1
2.146236
2
hackerrank/python/classes/multiple_inheritance.py
aditya2000/coding-practice
4
6621967
# Here's a fun example of what's going on with OrderedCounter class Tractor(): def plow(self): print("Plowing regular fields on earth!") class Farm(Tractor): def clean_barn(self): print("Mucking the stalls.") def do_farm_things(self): self.plow() self.clean_barn() ...
# Here's a fun example of what's going on with OrderedCounter class Tractor(): def plow(self): print("Plowing regular fields on earth!") class Farm(Tractor): def clean_barn(self): print("Mucking the stalls.") def do_farm_things(self): self.plow() self.clean_barn() ...
en
0.953791
# Here's a fun example of what's going on with OrderedCounter # Sweet, we have our Farm, and it has a basic tractor # But I'm moving to the Moon to start a MoonFarm, # which is the same as running a regular Farm, # but we need to use a MoonTractor that's modified for plowing moondirt. # Now we just need our stub MoonFa...
3.699408
4
importfrom/__init__.py
libeclipse/import-from
23
6621968
#!/usr/bin/env python from __future__ import print_function, unicode_literals from bs4 import BeautifulSoup import requests import json def request(url): if not url.startswith("http://") and not url.startswith("https://"): url = "http://" + url response = requests.get(url) if response.status_cod...
#!/usr/bin/env python from __future__ import print_function, unicode_literals from bs4 import BeautifulSoup import requests import json def request(url): if not url.startswith("http://") and not url.startswith("https://"): url = "http://" + url response = requests.get(url) if response.status_cod...
en
0.52593
#!/usr/bin/env python # Run tests. # Twitter # Pastebin # Gist # DNS # Self-implementation def hello(name): return 'Hello, %s!' % name def bye(name): return 'Bye, %s!' % name
3.076821
3
tests/loader/test_EVENTKG2MLoader.py
jinzhuoran/CogKGE
18
6621969
<reponame>jinzhuoran/CogKGE from cogkge import * import time loader = EVENTKG2MLoader(path='/home/hongbang/CogKTR/dataset/kr/EVENTKG2M/raw_data', download=True, download_path="CogKTR/dataset/") print("Without Preprocessing:") start_time = time.time() train_da...
from cogkge import * import time loader = EVENTKG2MLoader(path='/home/hongbang/CogKTR/dataset/kr/EVENTKG2M/raw_data', download=True, download_path="CogKTR/dataset/") print("Without Preprocessing:") start_time = time.time() train_data,valid_data,test_data = lo...
none
1
2.568166
3
backend/drugs/models.py
hippocampus13/IndianMedicineDB
0
6621970
from django.db import models class TimeStampedModel(models.Model): """ An abstract model which provides each model with a created and modified field """ created_on=models.DateTimeField(auto_now_add=True) modified_on=models.DateTimeField(auto_now=True) class Meta: abstract=True cla...
from django.db import models class TimeStampedModel(models.Model): """ An abstract model which provides each model with a created and modified field """ created_on=models.DateTimeField(auto_now_add=True) modified_on=models.DateTimeField(auto_now=True) class Meta: abstract=True cla...
en
0.984336
An abstract model which provides each model with a created and modified field #how to show that the datasource was entered by a user?
2.704995
3
src/pipeline/pipeline.py
lyonva/Nue
0
6621971
from sklearn.pipeline import FeatureUnion, _transform_one, _fit_transform_one from joblib import Parallel, delayed import numpy as np import pandas as pd class FeatureJoin(FeatureUnion): def transform(self, X): Xs = Parallel(n_jobs=self.n_jobs)( delayed(_transform_one)(trans, X, None, weight) ...
from sklearn.pipeline import FeatureUnion, _transform_one, _fit_transform_one from joblib import Parallel, delayed import numpy as np import pandas as pd class FeatureJoin(FeatureUnion): def transform(self, X): Xs = Parallel(n_jobs=self.n_jobs)( delayed(_transform_one)(trans, X, None, weight) ...
en
0.917324
# All transformers are None # All transformers are None
2.913344
3
demo/demo_calls.py
anjuchamantha/cellyzer---CDR-data-analyzer
11
6621972
<gh_stars>10-100 """ This is for manual testing the library """ import cellyzer as cz call_file_path = "demo_datasets/test_data/calls.csv" # callDataSet = cz.read_call(call_file_path) cz.read_msg("demo_datasets/test_data/messages.csv") cz.read_cell("demo_datasets/test_data/antennas.csv") callDataSet = cz.read_call(f...
""" This is for manual testing the library """ import cellyzer as cz call_file_path = "demo_datasets/test_data/calls.csv" # callDataSet = cz.read_call(call_file_path) cz.read_msg("demo_datasets/test_data/messages.csv") cz.read_cell("demo_datasets/test_data/antennas.csv") callDataSet = cz.read_call(file_path="demo_da...
en
0.470946
This is for manual testing the library # callDataSet = cz.read_call(call_file_path) # print(type(callDataSet).__name__) # cz.utils.print_dataset(callDataSet, name="Call Dataset") # # all_users_of_calls = callDataSet.get_all_users() # print(">> All Users in call dataSet : %s \n" % all_users_of_calls) # # # connected_use...
2.434094
2
__init__.py
ananya-007/smartapi-python-custom
1
6621973
from __future__ import unicode_literals,absolute_import from smartapi.smartConnect import SmartConnect # from smartapi.webSocket import WebSocket from smartapi.smartApiWebsocket import SmartWebSocket __all__ = ["SmartConnect","SmartWebSocket"]
from __future__ import unicode_literals,absolute_import from smartapi.smartConnect import SmartConnect # from smartapi.webSocket import WebSocket from smartapi.smartApiWebsocket import SmartWebSocket __all__ = ["SmartConnect","SmartWebSocket"]
ru
0.190302
# from smartapi.webSocket import WebSocket
1.350858
1
alembic/versions/26319c44a8d5_state_machine_states_extended.py
albertwo1978/atst
1
6621974
<gh_stars>1-10 """state machine states extended Revision ID: 26319c44a8d5 Revises: 59973fa17ded Create Date: 2020-01-22 15:54:03.186751 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "26319c44a8d5" # pragma: allowlist secret down_revision = "59973fa17ded" # p...
"""state machine states extended Revision ID: 26319c44a8d5 Revises: 59973fa17ded Create Date: 2020-01-22 15:54:03.186751 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "26319c44a8d5" # pragma: allowlist secret down_revision = "59973fa17ded" # pragma: allowlis...
en
0.502199
state machine states extended Revision ID: 26319c44a8d5 Revises: 59973fa17ded Create Date: 2020-01-22 15:54:03.186751 # revision identifiers, used by Alembic. # pragma: allowlist secret # pragma: allowlist secret # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### command...
1.358182
1
tensormap-server/shared/request/response.py
SahanDisa/tensormap
34
6621975
def generic_response(status_code, success, message, data=None): """ This function handles all the requests going through the backend :rtype: object """ response = { "success": success, "message": message, "data": data } return response, status_code
def generic_response(status_code, success, message, data=None): """ This function handles all the requests going through the backend :rtype: object """ response = { "success": success, "message": message, "data": data } return response, status_code
en
0.751512
This function handles all the requests going through the backend :rtype: object
2.38062
2
src/rosetta/utils/__init__.py
Zi-SH/rosetta
0
6621976
"""Module with various utilities for the bot.""" import logging from typing import TYPE_CHECKING if TYPE_CHECKING: from discord import Message from discord.ext.commands import Context from typing import Callable, Union logger = logging.getLogger(__name__) async def send_message(context, message): # pr...
"""Module with various utilities for the bot.""" import logging from typing import TYPE_CHECKING if TYPE_CHECKING: from discord import Message from discord.ext.commands import Context from typing import Callable, Union logger = logging.getLogger(__name__) async def send_message(context, message): # pr...
en
0.612544
Module with various utilities for the bot. # pragma: no cover Send a message if the the provided context is not None. # pragma: no cover Load a certain module. Returns whether or not the loading succeeded. # pragma: no cover Unload a certain module. Returns whether or not the unloading succeeded. Utility to make dialog...
2.793317
3
setup.py
ExecutableFile/dweepy
56
6621977
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup setup( name='dweepy', version='0.3.0', description='Dweepy is a Python client for dweet.io', long_description=open('README.rst').read(), author='<NAME>', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup setup( name='dweepy', version='0.3.0', description='Dweepy is a Python client for dweet.io', long_description=open('README.rst').read(), author='<NAME>', ...
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
1.564403
2
tests/unit/test_client_token.py
futureironman/braintree_python
182
6621978
<gh_stars>100-1000 from tests.test_helper import * class TestClientToken(unittest.TestCase): def test_credit_card_options_require_customer_id(self): for option in ["verify_card", "make_default", "fail_on_duplicate_payment_method"]: with self.assertRaisesRegexp(InvalidSignatureError, option): ...
from tests.test_helper import * class TestClientToken(unittest.TestCase): def test_credit_card_options_require_customer_id(self): for option in ["verify_card", "make_default", "fail_on_duplicate_payment_method"]: with self.assertRaisesRegexp(InvalidSignatureError, option): Clien...
none
1
2.625547
3
case_study.py
linshaoxin-maker/taas
4
6621979
<reponame>linshaoxin-maker/taas """ Example 1: Example 2: """ input_ids = [0, 1640, 3480, 4839, 286, 5, 78, 86, 11, 799, 107, 2156, 10, 1012, 7875, 1835, 7, 608, 99, 37, 473, 275, 479, 646, 3388, 510, 1215, 288, 742, 17657, 47385, 3277, 174, 7, 22, 283, 15, 159, 27785, 22, ...
""" Example 1: Example 2: """ input_ids = [0, 1640, 3480, 4839, 286, 5, 78, 86, 11, 799, 107, 2156, 10, 1012, 7875, 1835, 7, 608, 99, 37, 473, 275, 479, 646, 3388, 510, 1215, 288, 742, 17657, 47385, 3277, 174, 7, 22, 283, 15, 159, 27785, 22, 15, 5, 587, 112, 5403,...
en
0.233998
Example 1: Example 2: # results = np.random.rand(4, 3) # strings = strings = np.asarray([['a', 'b', 'c'], # ['d', 'e', 'f'], # ['g', 'h', 'i'], # ['j', 'k', 'l']]) # results = np.asarray([normalized_alpha]).reshape(43,4) #...
2.02369
2
docs/source/examples/test_examples.py
Nurdok/dotprod
0
6621980
<reponame>Nurdok/dotprod import json import pytest import pathlib import jsonschema this_dir = pathlib.Path(__file__).parent positive_examples = this_dir / 'positive' negative_examples = this_dir / 'negative' schema_path = this_dir / '..' / '..' / '..' / 'prod.json' @pytest.mark.parametrize("example_path", positive_...
import json import pytest import pathlib import jsonschema this_dir = pathlib.Path(__file__).parent positive_examples = this_dir / 'positive' negative_examples = this_dir / 'negative' schema_path = this_dir / '..' / '..' / '..' / 'prod.json' @pytest.mark.parametrize("example_path", positive_examples.rglob('*.prod'))...
none
1
2.413965
2
psychometrics/equating.py
deepdatadive/psychometric
2
6621981
<reponame>deepdatadive/psychometric<gh_stars>1-10 from psychometrics.simulation import simulate_items, simulate_people, item_vectors from psychometrics.CTT import examinee_score from psychometrics.test_info import test_descriptives import pandas as pd import numpy as np # Equating # todo: CTT - Linear Equating # Ctod...
from psychometrics.simulation import simulate_items, simulate_people, item_vectors from psychometrics.CTT import examinee_score from psychometrics.test_info import test_descriptives import pandas as pd import numpy as np # Equating # todo: CTT - Linear Equating # Ctodo: TT - Equipercentile Equating # # todo: IRT - Fi...
en
0.260441
# Equating # todo: CTT - Linear Equating # Ctodo: TT - Equipercentile Equating # # todo: IRT - Fixed Ancor # todo: IRT - Conversion Equating # todo concurrent IRT
2.729123
3
mozillians/graphql_profiles/urls.py
divyamoncy/mozillians
202
6621982
from django.conf import settings from django.conf.urls import url from mozillians.graphql_profiles import views app_name = 'graphql_profiles' urlpatterns = [ # App level graphQL url url(r'^$', views.MozilliansGraphQLView.as_view(graphiql=settings.DEV), name='graphql_view'), ]
from django.conf import settings from django.conf.urls import url from mozillians.graphql_profiles import views app_name = 'graphql_profiles' urlpatterns = [ # App level graphQL url url(r'^$', views.MozilliansGraphQLView.as_view(graphiql=settings.DEV), name='graphql_view'), ]
en
0.736585
# App level graphQL url
1.46738
1
sparkprs/__init__.py
ymzong/spark-pr-dashboard
37
6621983
<reponame>ymzong/spark-pr-dashboard import os from flask import Flask from flask.ext.cache import Cache from werkzeug.contrib.cache import SimpleCache is_production = os.getenv('SERVER_SOFTWARE', '').startswith('Google App Engine/') is_test = os.getenv('CI', '') == 'true' VERSION = os.environ.get('CURRENT_VERSION_ID',...
import os from flask import Flask from flask.ext.cache import Cache from werkzeug.contrib.cache import SimpleCache is_production = os.getenv('SERVER_SOFTWARE', '').startswith('Google App Engine/') is_test = os.getenv('CI', '') == 'true' VERSION = os.environ.get('CURRENT_VERSION_ID', 'UNKNOWN_VERSION') app = Flask('sp...
none
1
2.173497
2
TypeRX_server/chat/migrations/0002_auto_20180730_0227.py
kamaljohnson/TypRX-GAME
1
6621984
<reponame>kamaljohnson/TypRX-GAME # Generated by Django 2.0.7 on 2018-07-29 20:57 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('chat', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='chatmessages', ...
# Generated by Django 2.0.7 on 2018-07-29 20:57 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('chat', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='chatmessages', name='thread', ), ...
en
0.658215
# Generated by Django 2.0.7 on 2018-07-29 20:57
1.494304
1
dominio_ag.py
ITCRStevenLPZ/Proyecto2-Analisis-de-Algoritmos
0
6621985
from abc import abstractclassmethod from dominio import Dominio class DominioAG(Dominio): """ Representa el objeto de dominio que conoce los detalles de implementación y modelamiento de algún problema específico para ser resuelto con algoritmos genéticos. Métodos: generar(n) Construye ale...
from abc import abstractclassmethod from dominio import Dominio class DominioAG(Dominio): """ Representa el objeto de dominio que conoce los detalles de implementación y modelamiento de algún problema específico para ser resuelto con algoritmos genéticos. Métodos: generar(n) Construye ale...
es
0.938525
Representa el objeto de dominio que conoce los detalles de implementación y modelamiento de algún problema específico para ser resuelto con algoritmos genéticos. Métodos: generar(n) Construye aleatoriamente una lista de estructuras de datos que representa n posibles soluciones al problema....
3.857832
4
scripts/image_saver.py
NehilDanis/shape_registration
0
6621986
<reponame>NehilDanis/shape_registration<filename>scripts/image_saver.py #!/usr/bin/env python # license removed for brevity import rospy import sys from sensor_msgs.msg import Image import cv2 import os from cv_bridge import CvBridge, CvBridgeError # train path path = "/home/nehil/images_arm" class ImageSaver(): ...
#!/usr/bin/env python # license removed for brevity import rospy import sys from sensor_msgs.msg import Image import cv2 import os from cv_bridge import CvBridge, CvBridgeError # train path path = "/home/nehil/images_arm" class ImageSaver(): def __init__(self): self.set_id = 1 self.num_img = 1 ...
en
0.638856
#!/usr/bin/env python # license removed for brevity # train path # 1 Hz # Do stuff, maybe in a while loop # Sleeps for 1/rate sec if self.num_img <= 32: try: cv_image = self.bridge.imgmsg_to_cv2(img_msg, "bgr8") except CvBridgeError as e: print(e) #file_na...
2.780719
3
gr-azure-software-radio/python/default_credentials/default_credentials.py
pomeroy3/azure-software-radio
0
6621987
<filename>gr-azure-software-radio/python/default_credentials/default_credentials.py # pylint: disable=invalid-name # Copyright (c) Microsoft Corporation. # Licensed under the GNU General Public License v3.0 or later. # See License.txt in the project root for license information. # # pylint: disable=too-many-arguments ...
<filename>gr-azure-software-radio/python/default_credentials/default_credentials.py # pylint: disable=invalid-name # Copyright (c) Microsoft Corporation. # Licensed under the GNU General Public License v3.0 or later. # See License.txt in the project root for license information. # # pylint: disable=too-many-arguments ...
en
0.416281
# pylint: disable=invalid-name # Copyright (c) Microsoft Corporation. # Licensed under the GNU General Public License v3.0 or later. # See License.txt in the project root for license information. # # pylint: disable=too-many-arguments Returns DefaultAzureCredential Args: enable_cli_credential: enable CLI a...
1.888302
2
gdsfactory/watch.py
simbilod/gdsfactory
0
6621988
<reponame>simbilod/gdsfactory import logging import pathlib import sys import time import traceback from functools import partial from typing import Optional from watchdog.events import FileSystemEventHandler from watchdog.observers import Observer from gdsfactory.config import cwd from gdsfactory.pdk import get_acti...
import logging import pathlib import sys import time import traceback from functools import partial from typing import Optional from watchdog.events import FileSystemEventHandler from watchdog.observers import Observer from gdsfactory.config import cwd from gdsfactory.pdk import get_active_pdk from gdsfactory.read.fr...
en
0.682618
Captures pic.yml events. Register new YAML file into active pdk. pdk.cells[filename] = partial(from_yaml, filepath) # on_yaml_cell_modified.fire(c)
2.191919
2
app.py
chinmay29hub/typeroid
0
6621989
from click import option import typer from removebg import RemoveBg import config import time import yfinance as yf import pyfiglet import pandas as pd import matplotlib.pyplot as plt from wordcloud import WordCloud import random from pick import pick from scihub import SciHub app = typer.Typer() sh = SciHub() def r...
from click import option import typer from removebg import RemoveBg import config import time import yfinance as yf import pyfiglet import pandas as pd import matplotlib.pyplot as plt from wordcloud import WordCloud import random from pick import pick from scihub import SciHub app = typer.Typer() sh = SciHub() def r...
en
0.590404
#$%^&*()__+" please execute any one command.
2.710384
3
slack/migrations/0001_initial.py
oditorium/django-slack
2
6621990
<filename>slack/migrations/0001_initial.py<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-04-05 03:39 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import slack.models.keyvalue class Migration(migrations.Migration): i...
<filename>slack/migrations/0001_initial.py<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-04-05 03:39 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import slack.models.keyvalue class Migration(migrations.Migration): i...
en
0.812191
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-04-05 03:39
1.568487
2
python/dynamic_graph/sot/torque_control/identification/pos_ctrl/compress_hrpsys_data.py
nim65s/sot-torque-control
6
6621991
<reponame>nim65s/sot-torque-control # -*- coding: utf-8 -*- # flake8: noqa """ Created on Wed Apr 22 11:36:11 2015 Compress old data in the log format of hrpsys in a format that is compatible with the new data collected using the RealTimeTracer. @author: adelpret """ import matplotlib.pyplot as plt import numpy as n...
# -*- coding: utf-8 -*- # flake8: noqa """ Created on Wed Apr 22 11:36:11 2015 Compress old data in the log format of hrpsys in a format that is compatible with the new data collected using the RealTimeTracer. @author: adelpret """ import matplotlib.pyplot as plt import numpy as np from compute_estimates_from_senso...
en
0.696094
# -*- coding: utf-8 -*- # flake8: noqa Created on Wed Apr 22 11:36:11 2015 Compress old data in the log format of hrpsys in a format that is compatible with the new data collected using the RealTimeTracer. @author: adelpret #sensors = sensors[:5000]; #ref = ref[:5000]; #torques.shape[1]): # sampling period
2.001734
2
atcoder/abc/abc147_a.py
knuu/competitive-programming
1
6621992
<reponame>knuu/competitive-programming<filename>atcoder/abc/abc147_a.py A = [int(x) for x in input().split()] if sum(A) >= 22: print("bust") else: print("win")
A = [int(x) for x in input().split()] if sum(A) >= 22: print("bust") else: print("win")
none
1
3.285166
3
task4/conftest.py
rokimaru/rest_api_autotests
0
6621993
<reponame>rokimaru/rest_api_autotests import pytest def pytest_addoption(parser): parser.addoption('--url', type=str, default='https://ya.ru') parser.addoption('--status_code', type=int, default=200) @pytest.fixture def get_options(request): return (request.config.getoption('--url'), request...
import pytest def pytest_addoption(parser): parser.addoption('--url', type=str, default='https://ya.ru') parser.addoption('--status_code', type=int, default=200) @pytest.fixture def get_options(request): return (request.config.getoption('--url'), request.config.getoption('--status_code'))
none
1
2.170766
2
gemma_conf_search.py
jensengroup/substituent_insulater_screening
0
6621994
import sys import numpy as np import pandas as pd from multiprocessing import Pool from rdkit import Chem from rdkit.Chem import AllChem sys.path.append("/home/koerstz/projects/gemma_part2/QMC_6.2") from qmmol import QMMol from qmconf import QMConf from calculator.xtb import xTB from conformers.create_conformers im...
import sys import numpy as np import pandas as pd from multiprocessing import Pool from rdkit import Chem from rdkit.Chem import AllChem sys.path.append("/home/koerstz/projects/gemma_part2/QMC_6.2") from qmmol import QMMol from qmconf import QMConf from calculator.xtb import xTB from conformers.create_conformers im...
en
0.565155
ground state conformer search # hard coded for mogens # create conformers #print(qmmol.conformers) #print(qmmol.conformers[0].write_xyz()) #quit() #for conf in qmmol.conformers: # print(conf.label, conf.results['energy']) # conf.write_xyz() # Get most stable conformer. If most stable conformer # not identical to ...
2.065502
2
task_list_dev/__init__.py
HenriqueLR/task-list-dev
0
6621995
<reponame>HenriqueLR/task-list-dev # coding: utf-8 from task_list_dev import tools VERSION = (1, 0, 0, 'final', 0) def get_version(*args, **kwargs): from task_list_dev.utils.version import get_version return get_version(*args, **kwargs) __version__ = get_version(VERSION) __author__ = "<NAME>" __email__ =...
# coding: utf-8 from task_list_dev import tools VERSION = (1, 0, 0, 'final', 0) def get_version(*args, **kwargs): from task_list_dev.utils.version import get_version return get_version(*args, **kwargs) __version__ = get_version(VERSION) __author__ = "<NAME>" __email__ = "<EMAIL>" __url__ = "https://githu...
en
0.833554
# coding: utf-8
1.949049
2
code/my_layers.py
pmhalvor/imn
103
6621996
import keras.backend as K from keras.engine.topology import Layer from keras import initializers from keras import regularizers from keras import constraints from keras.layers.convolutional import Conv1D import numpy as np class Attention(Layer): def __init__(self, W_regularizer=None, b_regulariz...
import keras.backend as K from keras.engine.topology import Layer from keras import initializers from keras import regularizers from keras import constraints from keras.layers.convolutional import Conv1D import numpy as np class Attention(Layer): def __init__(self, W_regularizer=None, b_regulariz...
en
0.861602
Keras Layer that implements an Content Attention mechanism. Supports Masking. Keras Layer that implements an Content Attention mechanism. Supports Masking. # gold_prob is either 0 or 1
2.554902
3
src/local_simple_database/class_local_simple_database.py
stas-prokopiev/local_simple_database
3
6621997
"""Module with class to handle all simple local databases""" from __future__ import unicode_literals # Standard library imports import logging import datetime # Third party imports import dateutil.parser as parser # Local imports from local_simple_database.virtual_class_all_local_databases import \ VirtualAnyLoca...
"""Module with class to handle all simple local databases""" from __future__ import unicode_literals # Standard library imports import logging import datetime # Third party imports import dateutil.parser as parser # Local imports from local_simple_database.virtual_class_all_local_databases import \ VirtualAnyLoca...
en
0.483177
Module with class to handle all simple local databases # Standard library imports # Third party imports # Local imports This class was built to handle all one value DataBase-s ... Parent Attributes ----------------- self.str_path_main_database_dir : str Path to main folder with DataBase-s ...
2.558847
3
src/core/service/api/routing/Router.py
xxdunedainxx/Z-Py
0
6621998
from .IRouter import IRouter from ....conf.API.routes.RouteConfig import RouteConfig from ....util.app.ErrorFactory.api.RoutingErrors import InvalidAPIMethod,InvalidMethodForRoute,InternalAPIError # For Route check decorator from functools import wraps from flask_restplus import Namespace,Resource class Router(IRoute...
from .IRouter import IRouter from ....conf.API.routes.RouteConfig import RouteConfig from ....util.app.ErrorFactory.api.RoutingErrors import InvalidAPIMethod,InvalidMethodForRoute,InternalAPIError # For Route check decorator from functools import wraps from flask_restplus import Namespace,Resource class Router(IRoute...
en
0.224677
# For Route check decorator #def get_route(self,method: str)->str: # return self._validate_route( # method=method) # Custom Route Check Decorator #elif self.api_specific_routes[method] != route: # invalidRouteMethod=InvalidMethodForRoute( # method=method, # route=route) # return invalidRou...
2.286432
2
Python/CeV/Exercicios/ex86.py
WerickL/Learning
0
6621999
mat = [[], [], []] for L in range(0, 3): for C in range(0, 3): val = int(input(f'Digite o valor [{L + 1}][{C + 1}] da matriz: ')) mat[L].insert(C, val) for L in range(0, 3): for C in range(0, 3): print(f'[{mat[L][C]:^5}]', end='') print() # cont = 0 # for L in range(0, 3): # for ...
mat = [[], [], []] for L in range(0, 3): for C in range(0, 3): val = int(input(f'Digite o valor [{L + 1}][{C + 1}] da matriz: ')) mat[L].insert(C, val) for L in range(0, 3): for C in range(0, 3): print(f'[{mat[L][C]:^5}]', end='') print() # cont = 0 # for L in range(0, 3): # for ...
en
0.310957
# cont = 0 # for L in range(0, 3): # for C in range(0, 3): # print(f'[ {mat[cont][0]} ]', end='') # cont += 1 # print('\n', end='')
3.936171
4
src/my_model.py
gargrohin/Melody_extraction
3
6622000
''' Code for CRNN model and it's training. Also has the data_generator used. The neccessary reshaping of the matrices and normalization etc. done here. Take note of the paths to the data_generator. Previous knowledge of generators and keras/tensorflow required to understand the code. ''' import numpy as np import l...
''' Code for CRNN model and it's training. Also has the data_generator used. The neccessary reshaping of the matrices and normalization etc. done here. Take note of the paths to the data_generator. Previous knowledge of generators and keras/tensorflow required to understand the code. ''' import numpy as np import l...
en
0.526075
Code for CRNN model and it's training. Also has the data_generator used. The neccessary reshaping of the matrices and normalization etc. done here. Take note of the paths to the data_generator. Previous knowledge of generators and keras/tensorflow required to understand the code. #import logging #os.environ['TF_CPP_MI...
3.13283
3
MANRECT2.py
akashsuper2000/codechef-archive
0
6622001
<filename>MANRECT2.py import sys from math import ceil for i in range(int(input())): print('Q',0,0) sys.stdout.flush() n = int(input()) p = ceil(n/2) print('Q',p,0) sys.stdout.flush() a = int(input()) print('Q',0,p) sys.stdout.flush() b = int(input()) if(b<a): x = b ...
<filename>MANRECT2.py import sys from math import ceil for i in range(int(input())): print('Q',0,0) sys.stdout.flush() n = int(input()) p = ceil(n/2) print('Q',p,0) sys.stdout.flush() a = int(input()) print('Q',0,p) sys.stdout.flush() b = int(input()) if(b<a): x = b ...
none
1
3.214341
3
ytdownloader.py
z3oxs/ytdownloader
11
6622002
#!/usr/bin/env python3 # Coded By f4ll_py # Re-written by @arcticlimer """ Main application module. The main function runs a while window loop and parse his events """ import pytube import urllib from typing import Union from typing import Tuple from youtube import YouTube from youtube import Playlist from window...
#!/usr/bin/env python3 # Coded By f4ll_py # Re-written by @arcticlimer """ Main application module. The main function runs a while window loop and parse his events """ import pytube import urllib from typing import Union from typing import Tuple from youtube import YouTube from youtube import Playlist from window...
en
0.836566
#!/usr/bin/env python3 # Coded By f4ll_py # Re-written by @arcticlimer Main application module. The main function runs a while window loop and parse his events # Main window loop # Cleaning last search objects This is needed since pytube current version is quite unstable and can raise some unexpected errors. Func...
2.902989
3
pythonProject/venv/Lib/site-packages/flash/tool.py
NaseerAslamKhan/Salesman-Web-Application
0
6622003
import os import platform def mkdir(*args): for folder in args: if not os.path.exists(folder): os.makedirs(folder) def make_join(*args): folder = os.path.join(*args) mkdir(folder) return folder def list_dir(folder, condition=None, key=None, reverse=False): if condition is n...
import os import platform def mkdir(*args): for folder in args: if not os.path.exists(folder): os.makedirs(folder) def make_join(*args): folder = os.path.join(*args) mkdir(folder) return folder def list_dir(folder, condition=None, key=None, reverse=False): if condition is n...
none
1
3.059537
3
aoc2021/d03-1.py
jbudynek/advent-of-code
0
6622004
# coding: utf-8 import numpy as np def boom(input_val, DBG=True): leng = len(input_val[0]) gamma = "" epsilon = "" for k in range(leng): nb_0 = 0 nb_1 = 1 for ll in input_val: if ll[k] == '0': nb_0 += 1 if ll[k] == '1': ...
# coding: utf-8 import numpy as np def boom(input_val, DBG=True): leng = len(input_val[0]) gamma = "" epsilon = "" for k in range(leng): nb_0 = 0 nb_1 = 1 for ll in input_val: if ll[k] == '0': nb_0 += 1 if ll[k] == '1': ...
en
0.28395
# coding: utf-8 ############# # PART 1 - 3687446 OK
3.111903
3
setup.py
dubovyk/scvid
1
6622005
<gh_stars>1-10 # -*- coding: utf-8 -*- """setup.py: setuptools control.""" import re from setuptools import setup from pip.req import parse_requirements install_reqs = parse_requirements('requirements.txt', session=False) reqs = [str(ir.req) for ir in install_reqs] version = re.search( '^__version__\s*=\s*"(...
# -*- coding: utf-8 -*- """setup.py: setuptools control.""" import re from setuptools import setup from pip.req import parse_requirements install_reqs = parse_requirements('requirements.txt', session=False) reqs = [str(ir.req) for ir in install_reqs] version = re.search( '^__version__\s*=\s*"(.*)"', open...
en
0.635993
# -*- coding: utf-8 -*- setup.py: setuptools control.
1.726277
2
main.py
christiangra/python_classroom
1
6622006
<gh_stars>1-10 #usr/bin/python3.7
#usr/bin/python3.7
en
0.384653
#usr/bin/python3.7
1.084869
1
python/bv_build/subprocess_utils.py
sapetnioc/brainvisa-maker
1
6622007
import sys import subprocess def silent_check_call(command, cwd=None, env=None, exit=False): ''' Call a command without printing any output but raises a subprocess.CalledProcessError containing the full command output (both stdout and stderr) if the return code of the command is not zero. ''' p...
import sys import subprocess def silent_check_call(command, cwd=None, env=None, exit=False): ''' Call a command without printing any output but raises a subprocess.CalledProcessError containing the full command output (both stdout and stderr) if the return code of the command is not zero. ''' p...
en
0.65104
Call a command without printing any output but raises a subprocess.CalledProcessError containing the full command output (both stdout and stderr) if the return code of the command is not zero.
2.856111
3
zombieEscape/scenes.py
ScottJohnson02/Zombie-Escape
0
6622008
class Scene(object): def help(self): # brings the user to a help menu return "Here is all the commands you can enter in the field " class Apartment(Scene): def __init__(self): # message is the text that apperas after beating or losing a room self.message = ' ' self.name...
class Scene(object): def help(self): # brings the user to a help menu return "Here is all the commands you can enter in the field " class Apartment(Scene): def __init__(self): # message is the text that apperas after beating or losing a room self.message = ' ' self.name...
en
0.973829
# brings the user to a help menu # message is the text that apperas after beating or losing a room # text the user sees when entering a new room You enter an old abandoned appartment where it looks as if there was a fire. You suddenly encounter a walker but it is melted into the carpet you have a choice to make: 1....
3.779073
4
backend/geotiff.py
KhaledSharif/SimpleWMTS
2
6622009
<gh_stars>1-10 class GeoTIFF: """ GeoTIFF constructor: create class from a path to the GeoTIFF file Parameters ---------- path_to_file : str """ def __init__(self, path_to_file: str): from functions import get_gdal_info from os.path import abspath self.path = abspath...
class GeoTIFF: """ GeoTIFF constructor: create class from a path to the GeoTIFF file Parameters ---------- path_to_file : str """ def __init__(self, path_to_file: str): from functions import get_gdal_info from os.path import abspath self.path = abspath(path_to_file) ...
en
0.558058
GeoTIFF constructor: create class from a path to the GeoTIFF file Parameters ---------- path_to_file : str to_json: convert a GeoTIFF object to a dict to facilitate JSON conversion
3.555491
4
datasets/hcstvg_eval.py
antoyang/TubeDETR
4
6622010
from pathlib import Path from typing import Dict, List import numpy as np import util.dist as dist import json from functools import reduce from util.box_ops import np_box_iou class HCSTVGGiouEvaluator: def __init__( self, hcstvg_path: str, subset: str = "test", verbose: bool = ...
from pathlib import Path from typing import Dict, List import numpy as np import util.dist as dist import json from functools import reduce from util.box_ops import np_box_iou class HCSTVGGiouEvaluator: def __init__( self, hcstvg_path: str, subset: str = "test", verbose: bool = ...
en
0.693006
:param hcstvg_path: path to HC-STVG annotations :param subset: train, val or test :param verbose: whether to print more information or not :param iou_thresholds: IoU thresholds for the vIoU metrics :param fps: number of frames per second :param video_max_len: maximum number of fr...
2.47376
2
ball.py
RDShah/basketball
0
6622011
<gh_stars>0 from constants import dt import numpy as np from utilz import * class Ball: def __init__(self): self.position = np.zeros(2) self.acceleration = np.zeros(2) self.velocity = np.zeros(2) self.is_in_possession = False def set_acceleration(self,acc=np.zeros(2)): assert self.is_in_possession or (acc...
from constants import dt import numpy as np from utilz import * class Ball: def __init__(self): self.position = np.zeros(2) self.acceleration = np.zeros(2) self.velocity = np.zeros(2) self.is_in_possession = False def set_acceleration(self,acc=np.zeros(2)): assert self.is_in_possession or (acc==np.zeros(2...
none
1
3.57617
4
utils/macrostrat/utils/__init__.py
UW-Macrostrat/python-tools
0
6622012
""" This module houses utility functions that are shared between Sparrow's core and command-line interface. """ import os from contextlib import contextmanager from pathlib import Path from .logs import setup_stderr_logs, get_logger from .shell import cmd, split_args def relative_path(base, *parts)->Path: if not ...
""" This module houses utility functions that are shared between Sparrow's core and command-line interface. """ import os from contextlib import contextmanager from pathlib import Path from .logs import setup_stderr_logs, get_logger from .shell import cmd, split_args def relative_path(base, *parts)->Path: if not ...
en
0.939161
This module houses utility functions that are shared between Sparrow's core and command-line interface. A context manager which changes the working directory to the given path, and then changes it back to its previous value on exit.
2.517593
3
keypoint-network/trainer.py
RahulSajnani/DRACO-Weakly-Supervised-Dense-Reconstruction-And-Canonicalization-of-Objects
3
6622013
import torch from torch import nn from torch.nn import functional as F from torch.utils.data import DataLoader from torchvision import transforms import pytorch_lightning as pl from pytorch_lightning.core.lightning import LightningModule from Data_loaders import data_loader from models import hourglass class Heatmap...
import torch from torch import nn from torch.nn import functional as F from torch.utils.data import DataLoader from torchvision import transforms import pytorch_lightning as pl from pytorch_lightning.core.lightning import LightningModule from Data_loaders import data_loader from models import hourglass class Heatmap...
en
0.568857
loss for detection heatmap #print("check") # l = ((pred - ground_truth)**2) * weights #else: # l = ((pred - ground_truth)**2) #l = l.mean(dim=3).mean(dim=2).mean(dim=1) #[4, 16, 64, 64] -> [4] #print(l) # size = batch_size #print(combined_loss) Lightning calls this inside the training loop with the data from th...
2.434804
2
gowleyes/main.py
CrakeNotSnowman/gowleyes
0
6622014
<filename>gowleyes/main.py import argparse, textwrap import logging import os from utils import docsToEReader from utils import sendToEreader from utils import processWebPages def joinAndMakeDir(parent, child): newDir = os.path.join(parent, child) if not os.path.exists(newDir): os.makedirs(newD...
<filename>gowleyes/main.py import argparse, textwrap import logging import os from utils import docsToEReader from utils import sendToEreader from utils import processWebPages def joinAndMakeDir(parent, child): newDir = os.path.join(parent, child) if not os.path.exists(newDir): os.makedirs(newD...
en
0.787923
\ Program currently does not take input. #print(x) #args = interface() #alskd()
2.254266
2
esep/plot/plot_tmp.py
lyingTree/ESEP
0
6622015
<reponame>lyingTree/ESEP # -*- coding:utf-8 -*- """ ------------------------------------------------------------------------------- Project Name : ESEP File Name : plot_tmp.py Start D...
# -*- coding:utf-8 -*- """ ------------------------------------------------------------------------------- Project Name : ESEP File Name : plot_tmp.py Start Date : 2021-10-06 14:40 ...
en
0.199247
# -*- coding:utf-8 -*- ------------------------------------------------------------------------------- Project Name : ESEP File Name : plot_tmp.py Start Date : 2021-10-06 14:40 ...
2.519871
3
apps/labs/module01/SystemPerformanceApp.py
shyamsastha/iot-device
0
6622016
''' Created on Jan 17, 2019 Simple Python Application @author: <NAME> ''' from labs.module01 import SystemPerformanceAdaptor #initiating the adaptor sysPerfAdaptor = SystemPerformanceAdaptor.SystemPerformanceAdaptor() #initiating the daemon sysPerfAdaptor.daemon = True print("Starting system performance app daemon th...
''' Created on Jan 17, 2019 Simple Python Application @author: <NAME> ''' from labs.module01 import SystemPerformanceAdaptor #initiating the adaptor sysPerfAdaptor = SystemPerformanceAdaptor.SystemPerformanceAdaptor() #initiating the daemon sysPerfAdaptor.daemon = True print("Starting system performance app daemon th...
en
0.561817
Created on Jan 17, 2019 Simple Python Application @author: <NAME> #initiating the adaptor #initiating the daemon #enabling the adaptor #starting the thread #condition for the infinite loop
2.688657
3
setup.py
musketeer90/smarterp
2
6622017
# -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('requirements.txt') as f: install_requires = f.read().strip().split('\n') # get version from __version__ variable in smarterp/__init__.py from smarterp import __version__ as version setup( name='smarterp', version=version, description=...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('requirements.txt') as f: install_requires = f.read().strip().split('\n') # get version from __version__ variable in smarterp/__init__.py from smarterp import __version__ as version setup( name='smarterp', version=version, description=...
en
0.525048
# -*- coding: utf-8 -*- # get version from __version__ variable in smarterp/__init__.py
1.586898
2
pellet_labels/eval_ensemble.py
mpascucci/AST-image-processing
6
6622018
<gh_stars>1-10 import argparse import os import pickle import numpy as np import tensorflow as tf import pandas as pd from trainer import model from trainer.pellet_list import PELLET_LIST, REMOVED_CLASSES from trainer import task from util import gcs_util as util WORKING_DIR = os.getcwd() MODEL_FOLDER = 'uncertainty...
import argparse import os import pickle import numpy as np import tensorflow as tf import pandas as pd from trainer import model from trainer.pellet_list import PELLET_LIST, REMOVED_CLASSES from trainer import task from util import gcs_util as util WORKING_DIR = os.getcwd() MODEL_FOLDER = 'uncertainty_pellet_labels_...
en
0.785848
# For a reference on distribution entropy, see [1] # [1]: https://peltarion.com/knowledge-center/documentation/modeling-view/build-an-ai-model/loss-functions/categorical-crossentropy # Compute the deviation between the max probability of each prediction # Take an ensemble of models trained on gcloud and evaluate their ...
2.376707
2
run_2D.py
jcartus/QLearningExperiments
0
6622019
"""This script will run the agent in a 1 D environment and plot its learning progress Author: <NAME>, 22.12.2021 """ import numpy as np import matplotlib.pyplot as plt from environment import DiscreteEnvironment from agent import AgentBase from analysis import AnalyzerEpisode, AnalyzerRun, animate_episodes import ...
"""This script will run the agent in a 1 D environment and plot its learning progress Author: <NAME>, 22.12.2021 """ import numpy as np import matplotlib.pyplot as plt from environment import DiscreteEnvironment from agent import AgentBase from analysis import AnalyzerEpisode, AnalyzerRun, animate_episodes import ...
en
0.523506
This script will run the agent in a 1 D environment and plot its learning progress Author: <NAME>, 22.12.2021 #game_map, win_values, death_values = generate_course_1() #game_map, win_values, death_values = generate_square() #init_mode="random", #--- do training --- #--- #--- plot analysis plots --- #--- #--- do addit...
3.290825
3
beartype_test/a00_unit/a00_util/test_utilobject.py
posita/beartype
1,056
6622020
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2021 Beartype authors. # See "LICENSE" for further details. ''' **Beartype object utility unit tests.** This submodule unit tests the public API of the private :mod:`beartype._util.utilobject` s...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2021 Beartype authors. # See "LICENSE" for further details. ''' **Beartype object utility unit tests.** This submodule unit tests the public API of the private :mod:`beartype._util.utilobject` s...
en
0.464857
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2021 Beartype authors. # See "LICENSE" for further details. **Beartype object utility unit tests.** This submodule unit tests the public API of the private :mod:`beartype._util.utilobject` submod...
2.016655
2
src/utils/logging.py
JeremyAndress/Flask-Celery
2
6622021
import os import uuid import logging from logging.handlers import RotatingFileHandler BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) LOG_FILENAME_INFO = BASE_DIR+'/logs/info.log' logging.basicConfig( handlers=[ logging.StreamHandler(), RotatingFileHandler(LOG_FILENAME_INFO,...
import os import uuid import logging from logging.handlers import RotatingFileHandler BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) LOG_FILENAME_INFO = BASE_DIR+'/logs/info.log' logging.basicConfig( handlers=[ logging.StreamHandler(), RotatingFileHandler(LOG_FILENAME_INFO,...
none
1
2.506395
3
text/_form/cascade/property/_op/declare.py
jedhsu/text
0
6622022
<gh_stars>0 """ *Property-Declare* Declare a property. """ from ._operator import PropertyOperator class PropertyDeclare( PropertyOperator, ): pass """ *Declaration-Block* """ from typing import Sequence from dataclasses import dataclass __all__ = ["DeclarationBlock"] from .declaration im...
""" *Property-Declare* Declare a property. """ from ._operator import PropertyOperator class PropertyDeclare( PropertyOperator, ): pass """ *Declaration-Block* """ from typing import Sequence from dataclasses import dataclass __all__ = ["DeclarationBlock"] from .declaration import Declara...
en
0.533701
*Property-Declare* Declare a property. *Declaration-Block* Indents a line of text.
2.950812
3
FOSSEE_math/email_config.py
Sarathsathyan/django_math.animations
2
6622023
EMAIL_HOST = 'your smtp host name' EMAIL_PORT = 'PORT Number' EMAIL_HOST_USER = 'your username' EMAIL_HOST_PASSWORD = '<PASSWORD>' EMAIL_USE_TLS = True SENDER_EMAIL = 'your email address' SECRET_KEY_SETTINGS = ''
EMAIL_HOST = 'your smtp host name' EMAIL_PORT = 'PORT Number' EMAIL_HOST_USER = 'your username' EMAIL_HOST_PASSWORD = '<PASSWORD>' EMAIL_USE_TLS = True SENDER_EMAIL = 'your email address' SECRET_KEY_SETTINGS = ''
none
1
1.22649
1
src/web/schools/migrations/0011_auto_20170222_2057.py
fossabot/SIStema
5
6622024
<reponame>fossabot/SIStema # -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-22 20:57 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ m...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-22 20:57 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
en
0.741488
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-22 20:57
1.671421
2
tfbp/train/lib.py
klauscc/tfbp
0
6622025
# -*- coding: utf-8 -*- #================================================================ # God Bless You. # # author: klaus # email: <EMAIL> # created date: 2019/12/17 # description: # #================================================================ import tensorflow as tf keras = tf.keras def build_mode...
# -*- coding: utf-8 -*- #================================================================ # God Bless You. # # author: klaus # email: <EMAIL> # created date: 2019/12/17 # description: # #================================================================ import tensorflow as tf keras = tf.keras def build_mode...
en
0.409641
# -*- coding: utf-8 -*- #================================================================ # God Bless You. # # author: klaus # email: <EMAIL> # created date: 2019/12/17 # description: # #================================================================ TODO: Docstring for build_model. Args: model:...
2.150626
2
secondary-voice-server-AI/assem-vc/datasets/resample.py
doongu/pnu_opensource_hack
178
6622026
import os import glob import tqdm from itertools import repeat from multiprocessing import Pool, freeze_support from argparse import ArgumentParser def resampling(wavdir, sr): newdir = wavdir.replace('.wav', '-22k.wav') os.system('ffmpeg -hide_banner -loglevel panic -y -i %s -ar %d %s' % (wavdir, sr, ...
import os import glob import tqdm from itertools import repeat from multiprocessing import Pool, freeze_support from argparse import ArgumentParser def resampling(wavdir, sr): newdir = wavdir.replace('.wav', '-22k.wav') os.system('ffmpeg -hide_banner -loglevel panic -y -i %s -ar %d %s' % (wavdir, sr, ...
none
1
2.420602
2
UCourse/course_homes/migrations/0018_coursehome_register_date.py
Natsu1270/UCourse
1
6622027
<filename>UCourse/course_homes/migrations/0018_coursehome_register_date.py # Generated by Django 3.0.3 on 2020-06-02 16:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('course_homes', '0017_auto_20200531_2241'), ] operations = [ migra...
<filename>UCourse/course_homes/migrations/0018_coursehome_register_date.py # Generated by Django 3.0.3 on 2020-06-02 16:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('course_homes', '0017_auto_20200531_2241'), ] operations = [ migra...
en
0.831736
# Generated by Django 3.0.3 on 2020-06-02 16:53
1.575571
2
coding/learn_gevent/gevent_06_echoserver.py
yatao91/learning_road
3
6622028
# -*- coding: utf-8 -*- from __future__ import print_function from gevent.server import StreamServer def echo(socket, address): print("New connection from %s:%s" % address) socket.sendall(b"Welcome to the echo server! Type quit to exit.\r\n") rfileobj = socket.makefile(mode='rb') while True: ...
# -*- coding: utf-8 -*- from __future__ import print_function from gevent.server import StreamServer def echo(socket, address): print("New connection from %s:%s" % address) socket.sendall(b"Welcome to the echo server! Type quit to exit.\r\n") rfileobj = socket.makefile(mode='rb') while True: ...
en
0.769321
# -*- coding: utf-8 -*-
2.91319
3
graph_networks/GIN.py
hengwei-chan/graph_network_demo
1
6622029
<reponame>hengwei-chan/graph_network_demo import tensorflow as tf import numpy as np import copy from graph_networks.utilities import CustomDropout as dropout class GIN(tf.keras.Model): ''' This class is an implementation of the GIN-E model (Edge extention of Xu et al. 2019). ''' def __init__(sel...
import tensorflow as tf import numpy as np import copy from graph_networks.utilities import CustomDropout as dropout class GIN(tf.keras.Model): ''' This class is an implementation of the GIN-E model (Edge extention of Xu et al. 2019). ''' def __init__(self,config,return_hv=False): super(G...
en
0.75616
This class is an implementation of the GIN-E model (Edge extention of Xu et al. 2019). # initialize # aggregate info and combine # massage passing gin
2.638109
3
solutions/problem3.py
wy/ProjectEuler
0
6622030
# coding: utf8 # Author: <NAME> (~wy) # Date: 2017 def prime(n): if n > 1: for i in range(2,n): if n % i == 0: return False return True else: return False def smallestprimedivisor(p): for i in range(2,p): if p % i == 0 and prime(i): r...
# coding: utf8 # Author: <NAME> (~wy) # Date: 2017 def prime(n): if n > 1: for i in range(2,n): if n % i == 0: return False return True else: return False def smallestprimedivisor(p): for i in range(2,p): if p % i == 0 and prime(i): r...
en
0.742858
# coding: utf8 # Author: <NAME> (~wy) # Date: 2017 # find the first prime divisor of p
4.096403
4
Day 4 - Beginner - Randomisation and Python Lists/Day4_Project.py
AkashKumarSingh11032001/100-Days-Python-Bootcamp-By-AngelaYu
0
6622031
<filename>Day 4 - Beginner - Randomisation and Python Lists/Day4_Project.py # DAY 4 FINAL PROJECTS import random rock = ''' _______ ---' ____) (_____) (_____) (____) ---.__(___) ''' paper = ''' _______ ---' ____)____ ______) _______) _______) ---.__________)...
<filename>Day 4 - Beginner - Randomisation and Python Lists/Day4_Project.py # DAY 4 FINAL PROJECTS import random rock = ''' _______ ---' ____) (_____) (_____) (____) ---.__(___) ''' paper = ''' _______ ---' ____)____ ______) _______) _______) ---.__________)...
es
0.134412
# DAY 4 FINAL PROJECTS _______ ---' ____) (_____) (_____) (____) ---.__(___) _______ ---' ____)____ ______) _______) _______) ---.__________) _______ ---' ____)____ ______) __________) (____) ---.__(___)
4.120795
4
botty_mcbotface/plugins/help.py
ColumbiaSC-Tech/botty_mcbotface
11
6622032
# -*- coding: utf-8 -*- from slackbot.bot import respond_to, re help_msg = '\nI\'m not a very smart baht...\n' \ 'You can command me with _dot_ commands.\n' \ 'Here\'s what I know so far\n' \ '`.(8|8ball|eightball) <question>` - Ask the magic 8ball a question\n' \ '`.calenda...
# -*- coding: utf-8 -*- from slackbot.bot import respond_to, re help_msg = '\nI\'m not a very smart baht...\n' \ 'You can command me with _dot_ commands.\n' \ 'Here\'s what I know so far\n' \ '`.(8|8ball|eightball) <question>` - Ask the magic 8ball a question\n' \ '`.calenda...
en
0.790764
# -*- coding: utf-8 -*- List botty's current commands :param message: Message to bot requesting help :return: Message to user
3.089408
3
core/test/test_base.py
uktrade/fadmin2
3
6622033
<filename>core/test/test_base.py from django.contrib.auth import get_user_model from django.test import ( modify_settings, override_settings, TestCase, ) TEST_EMAIL = "<EMAIL>" # /PS-IGNORE @modify_settings( MIDDLEWARE={ 'remove': 'authbroker_client.middleware.ProtectAllViewsMiddleware',...
<filename>core/test/test_base.py from django.contrib.auth import get_user_model from django.test import ( modify_settings, override_settings, TestCase, ) TEST_EMAIL = "<EMAIL>" # /PS-IGNORE @modify_settings( MIDDLEWARE={ 'remove': 'authbroker_client.middleware.ProtectAllViewsMiddleware',...
it
0.261628
# /PS-IGNORE
2.174466
2
pipeline/utils/visualize.py
nmiles2718/hst_cosmic_rays
1
6622034
<filename>pipeline/utils/visualize.py #!/usr/bin/env python """ A module to facilitate the visualization of data generated by the pipeline. """ from collections import Iterable import logging from itertools import chain from astropy.io import fits from astropy.time import Time from astropy.stats import sigma_clipped_...
<filename>pipeline/utils/visualize.py #!/usr/bin/env python """ A module to facilitate the visualization of data generated by the pipeline. """ from collections import Iterable import logging from itertools import chain from astropy.io import fits from astropy.time import Time from astropy.stats import sigma_clipped_...
en
0.508808
#!/usr/bin/env python A module to facilitate the visualization of data generated by the pipeline. # import costools #mpl.use('qt5agg') # from matplotlib import rc # rc('text', usetex=True) A class for visualizing data generated by the pipeline Convenience method for creating a matplotlib figure Parameters ...
2.335313
2
Lane_process.py
bobd988/laneline-advanced
0
6622035
<filename>Lane_process.py import os import numpy as np import cv2 import pickle import glob from moviepy.editor import VideoFileClip import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from moviepy.editor import VideoFileClip CAMERA_PARAMETERS_FILE = "parameter_camera.pkl" WARP_PARAMETERS_FILE = "p...
<filename>Lane_process.py import os import numpy as np import cv2 import pickle import glob from moviepy.editor import VideoFileClip import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from moviepy.editor import VideoFileClip CAMERA_PARAMETERS_FILE = "parameter_camera.pkl" WARP_PARAMETERS_FILE = "p...
en
0.762283
# undistort image # try to load from file # Calibrate camera using the OpenCv chessboad method # prepare object points # Convert to grayscale # Find the chessboard corners # If found, draw corners #Append corners and object # Draw and display the corners # Read Warp parameter based on src_points and dst_points # Conve...
2.73009
3
lib/array_to_delimited_values.py
erictheise/trctr-pllr
0
6622036
import io, csv from flask import make_response def array_to_delimited_values(array, delimiter): si = io.StringIO() writer = csv.writer(si, delimiter=delimiter, quoting=csv.QUOTE_NONNUMERIC) writer.writerows(array) output = make_response(si.getvalue()) # output.headers["Content-Disposition"] = "atta...
import io, csv from flask import make_response def array_to_delimited_values(array, delimiter): si = io.StringIO() writer = csv.writer(si, delimiter=delimiter, quoting=csv.QUOTE_NONNUMERIC) writer.writerows(array) output = make_response(si.getvalue()) # output.headers["Content-Disposition"] = "atta...
en
0.415418
# output.headers["Content-Disposition"] = "attachment; filename=trctr-pllr.csv" # output.headers["Content-type"] = "text/csv"
2.949726
3
cparser/Node.py
rusphantom/cparser
3
6622037
from cparser import analyzer class NodeChildIterator(): def __init__(self, node): self.node = node self.ptr = 0 def __next__(self): if self.ptr >= self.node.size(): raise StopIteration else: self.ptr += 1 return self.node.get(self.ptr-1) d...
from cparser import analyzer class NodeChildIterator(): def __init__(self, node): self.node = node self.ptr = 0 def __next__(self): if self.ptr >= self.node.size(): raise StopIteration else: self.ptr += 1 return self.node.get(self.ptr-1) d...
none
1
2.970099
3
aoc2018/aoc2018.py
TonyFlury/aoc2018
0
6622038
<filename>aoc2018/aoc2018.py<gh_stars>0 #!/usr/bin/env python # coding=utf-8 """ # aoc2018 : Advent of Code 2018 Summary : Solve the various AOC challenges from 2018 Use Case : Solve AOC2018 Testable Statements : ... """ from . version import *
<filename>aoc2018/aoc2018.py<gh_stars>0 #!/usr/bin/env python # coding=utf-8 """ # aoc2018 : Advent of Code 2018 Summary : Solve the various AOC challenges from 2018 Use Case : Solve AOC2018 Testable Statements : ... """ from . version import *
en
0.516442
#!/usr/bin/env python # coding=utf-8 # aoc2018 : Advent of Code 2018 Summary : Solve the various AOC challenges from 2018 Use Case : Solve AOC2018 Testable Statements : ...
1.119033
1
scripts/helpful_scripts.py
AndreyGordeev1234/solidity-fund-me-app
0
6622039
<reponame>AndreyGordeev1234/solidity-fund-me-app from brownie import network, accounts, config, MockV3Aggregator FORKED_LOCAL_ENVIRONMENTS = ["mainnet-fork", "mainnet-fork-dev"] LOCAL_BLOCKCHAIN_ENVIRONMENTS = ["development", "ganache-local"] DECIMALS = 8 STARTING_PRICE = 200000000000 def get_account(): if netw...
from brownie import network, accounts, config, MockV3Aggregator FORKED_LOCAL_ENVIRONMENTS = ["mainnet-fork", "mainnet-fork-dev"] LOCAL_BLOCKCHAIN_ENVIRONMENTS = ["development", "ganache-local"] DECIMALS = 8 STARTING_PRICE = 200000000000 def get_account(): if network.show_active() in LOCAL_BLOCKCHAIN_ENVIRONMENT...
none
1
2.012769
2
nomadgen/api/docker_task.py
smintz/nomadgen
19
6622040
<reponame>smintz/nomadgen from nomadgen.jobspec.ttypes import DriverConfig, DockerDriverAuth from nomadgen.api.task import NGTask class DockerTask(NGTask): def setTaskDriver(self): self.Driver = "docker" self.Config = DriverConfig( image=self.image, force_pull=self.force_pull_image, po...
from nomadgen.jobspec.ttypes import DriverConfig, DockerDriverAuth from nomadgen.api.task import NGTask class DockerTask(NGTask): def setTaskDriver(self): self.Driver = "docker" self.Config = DriverConfig( image=self.image, force_pull=self.force_pull_image, port_map=[] ) d...
none
1
2.074787
2
check_json.py
alexgorin/dc_bots
0
6622041
#!/usr/bin/env python import json import sys filename = sys.argv[1] with open(filename) as f: data = f.read() json.loads(data) print "%s is a correct json file" % filename
#!/usr/bin/env python import json import sys filename = sys.argv[1] with open(filename) as f: data = f.read() json.loads(data) print "%s is a correct json file" % filename
ru
0.26433
#!/usr/bin/env python
2.729214
3
bolshoi/fixLightconeRAs.py
sniemi/SamPy
5
6622042
import glob import os def fixLigconeRAs(files): ''' Fixes the problem that some lightcones had negative RAs. The fix is extemely crude one only adds 360 to the RA value. :param files: a list of files to be fixed :type files: list ''' for filename in files: removeFile = True ...
import glob import os def fixLigconeRAs(files): ''' Fixes the problem that some lightcones had negative RAs. The fix is extemely crude one only adds 360 to the RA value. :param files: a list of files to be fixed :type files: list ''' for filename in files: removeFile = True ...
en
0.854679
Fixes the problem that some lightcones had negative RAs. The fix is extemely crude one only adds 360 to the RA value. :param files: a list of files to be fixed :type files: list
2.480851
2
main/views.py
Shu-Naing/online_shopping
0
6622043
<reponame>Shu-Naing/online_shopping<gh_stars>0 from django.shortcuts import render, redirect, HttpResponseRedirect, get_object_or_404 from django.views.decorators.http import require_POST from django.contrib.sites.shortcuts import get_current_site from django.core.mail import EmailMessage from django.template.loader im...
from django.shortcuts import render, redirect, HttpResponseRedirect, get_object_or_404 from django.views.decorators.http import require_POST from django.contrib.sites.shortcuts import get_current_site from django.core.mail import EmailMessage from django.template.loader import render_to_string from django.http import H...
en
0.619675
#search Product
2.019088
2
lib/pyasm/__init__.py
clayne/syringe-1
25
6622044
<gh_stars>10-100 import marshal,opcode from . import utils from .assemble import assemble,oplength,assemble_insn from .disassemble import disassemble,fetch_op,fetch_insn # for lazy typists... asm = assemble dis = disassemble def pretty_dis(obj, address=0): ''' returns a disassembly w/ labels ''' insns = [] ...
import marshal,opcode from . import utils from .assemble import assemble,oplength,assemble_insn from .disassemble import disassemble,fetch_op,fetch_insn # for lazy typists... asm = assemble dis = disassemble def pretty_dis(obj, address=0): ''' returns a disassembly w/ labels ''' insns = [] labels = {} ...
en
0.891774
# for lazy typists... returns a disassembly w/ labels # collect labels and other fun stuff # format results (might want to align this into some columns ## yes, i know the function name is really ironic. ;) # FIXME: hardcoded length is 32. (why would you need such huge names for a label anyways)
2.558032
3
RecoTracker/FinalTrackSelectors/python/classifierTest_cff.py
ckamtsikis/cmssw
852
6622045
<gh_stars>100-1000 from RecoTracker.FinalTrackSelectors.TrackCutClassifier_cff import * from RecoTracker.FinalTrackSelectors.TrackMVAClassifierPrompt_cfi import * from RecoTracker.FinalTrackSelectors.TrackMVAClassifierDetached_cfi import * testTrackClassifier1 = TrackMVAClassifierPrompt.clone( src = 'initialStepTr...
from RecoTracker.FinalTrackSelectors.TrackCutClassifier_cff import * from RecoTracker.FinalTrackSelectors.TrackMVAClassifierPrompt_cfi import * from RecoTracker.FinalTrackSelectors.TrackMVAClassifierDetached_cfi import * testTrackClassifier1 = TrackMVAClassifierPrompt.clone( src = 'initialStepTracks', mva = di...
none
1
1.465198
1
COVID19_BOT.py
pronayguha13/COVID19_BOT
2
6622046
# -*- coding: utf-8 -*- """ Created on Fri Mar 20 10:46:47 2020 @author: Pronay ProjectName:COVID19_BOT """ import datetime import json import requests # import argparse import logging from bs4 import BeautifulSoup from tabulate import tabulate from slack_client import slacker FORMAT = '[%(asctime)-...
# -*- coding: utf-8 -*- """ Created on Fri Mar 20 10:46:47 2020 @author: Pronay ProjectName:COVID19_BOT """ import datetime import json import requests # import argparse import logging from bs4 import BeautifulSoup from tabulate import tabulate from slack_client import slacker FORMAT = '[%(asctime)-...
en
0.461358
# -*- coding: utf-8 -*- Created on Fri Mar 20 10:46:47 2020 @author: Pronay ProjectName:COVID19_BOT # import argparse # last row # save(temp) # for x in stats: # cur_data.append(x[2:6]) # print(cur_data) # slacker()(slack_text) # slacker()(slack_text) # events_info="Previous Summary :: " # print(table)
2.508064
3
utils/fdfs/storage.py
Bean-jun/shop
0
6622047
import os from django.core.files.storage import Storage from fdfs_client.client import Fdfs_client, get_tracker_conf from django.conf import settings class FDFSStorage(Storage): """ 自定义文件存储类 """ def _open(self, name, mode='rb'): # 打开文件时使用 pass def _save(self, name, content): ...
import os from django.core.files.storage import Storage from fdfs_client.client import Fdfs_client, get_tracker_conf from django.conf import settings class FDFSStorage(Storage): """ 自定义文件存储类 """ def _open(self, name, mode='rb'): # 打开文件时使用 pass def _save(self, name, content): ...
zh
0.986093
自定义文件存储类 # 打开文件时使用 # 保存文件时使用 # name:选择上传文件的名称 # content: 包含上传文件内容的File类的对象 # 获取配置文件 # 创建一个Fdfs_client对象 # 上传文件到fastdfs系统中 # 判断内容是否判断成功 # 上传失败 # 获取返回文件ID # 返回保存文件,这里返回的是什么,数据表里面就会保存什么内容,注意返回类型为bytes类型 # Django判断文件名是否可用 # 返回访问文件的URL路径 # name: 表中文件的路径ID
2.257743
2
seaborn_analyzer/custom_reg_plot.py
c60evaporator/seaborn-analyzer
38
6622048
<filename>seaborn_analyzer/custom_reg_plot.py from typing import List, Dict import seaborn as sns import matplotlib.pyplot as plt import numbers import numpy as np import pandas as pd from scipy import stats from sklearn.linear_model import LinearRegression from sklearn.metrics import r2_score, mean_absolute_error, mea...
<filename>seaborn_analyzer/custom_reg_plot.py from typing import List, Dict import seaborn as sns import matplotlib.pyplot as plt import numbers import numpy as np import pandas as pd from scipy import stats from sklearn.linear_model import LinearRegression from sklearn.metrics import r2_score, mean_absolute_error, mea...
ja
0.545925
# regression_heat_plotメソッド (回帰モデルヒートマップ表示)における、散布図カラーマップ 指定桁数で小数を丸める Parameters ---------- src : float 丸め対象の数値 rounddigit : int フィッティング線の表示範囲(標準偏差の何倍まで表示するか指定) method : int 桁数決定手法('decimal':小数点以下, 'sig':有効数字(Decimal指定), 'format':formatで有効桁数指定)...
2.546615
3
get_repos.py
Mmesek/MFramework.py
0
6622049
<gh_stars>0 import os, importlib try: from git import Repo HAS_GIT = True except ImportError: print("Couldn't find git, repos won't be cloned or updated if missing") HAS_GIT = False BASE_PATH = "/repos/" def make_pth(package: str): path = BASE_PATH + package + "/" + package with open(f'{pack...
import os, importlib try: from git import Repo HAS_GIT = True except ImportError: print("Couldn't find git, repos won't be cloned or updated if missing") HAS_GIT = False BASE_PATH = "/repos/" def make_pth(package: str): path = BASE_PATH + package + "/" + package with open(f'{package}.pth','w...
none
1
2.539119
3
Net.py
xuhongzuo/plsd
1
6622050
import torch import torch.nn.functional as F import torch.nn as nn import numpy as np import logging class BaseNet(nn.Module): """Base class for all neural networks.""" def __init__(self): super().__init__() self.logger = logging.getLogger(self.__class__.__name__) self.rep_dim = None ...
import torch import torch.nn.functional as F import torch.nn as nn import numpy as np import logging class BaseNet(nn.Module): """Base class for all neural networks.""" def __init__(self): super().__init__() self.logger = logging.getLogger(self.__class__.__name__) self.rep_dim = None ...
en
0.524969
Base class for all neural networks. # representation dimensionality, i.e. dim of the code layer or last layer Forward pass logic :return: Network output Network summary. # hidden layer # output layer
3.071465
3