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 |
|---|---|---|---|---|---|---|---|---|---|---|
aries_cloudagent/protocols/out_of_band/v1_0/manager.py | Luis-GA/aries-cloudagent-python | 0 | 6629951 | <reponame>Luis-GA/aries-cloudagent-python
"""Classes to manage connections."""
import asyncio
import json
import logging
from typing import Mapping, Sequence, Optional
from ....connections.base_manager import BaseConnectionManager
from ....connections.models.conn_record import ConnRecord
from ....connections.util im... | """Classes to manage connections."""
import asyncio
import json
import logging
from typing import Mapping, Sequence, Optional
from ....connections.base_manager import BaseConnectionManager
from ....connections.models.conn_record import ConnRecord
from ....connections.util import mediation_record_if_id
from ....core.... | en | 0.735382 | Classes to manage connections. Out of band error. Out of band error for unimplemented functionality. Class for managing out of band messages. Initialize a OutOfBandManager. Args: session: The profile session for this out of band manager Accessor for the current profile session. Returns: ... | 1.477814 | 1 |
app/core/tests/test_admin.py | PythonDjangoJavascript/advanced_django_rest_api_with_tdd | 0 | 6629952 | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTest(TestCase):
"""Test admin side methods working"""
def setUp(self):
"""Setup method will be available to every method"""
self.client = Client()
se... | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTest(TestCase):
"""Test admin side methods working"""
def setUp(self):
"""Setup method will be available to every method"""
self.client = Client()
se... | en | 0.733805 | Test admin side methods working Setup method will be available to every method test created user listed in user list Test user edit page available # Thsi args value retuns the value and add it at the end of the url # ie. /admin/core/user/user_id test user creae page available | 2.620917 | 3 |
assesments/urls.py | gotoiot/service-django-rest-api | 0 | 6629953 | <filename>assesments/urls.py
from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from assesments import views
app_name = 'assesments'
urlpatterns = [
path('', views.api_root, name='assesments-home'),
path('assesments/', views.AssesmentList.as_view(), name='assesment-lis... | <filename>assesments/urls.py
from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from assesments import views
app_name = 'assesments'
urlpatterns = [
path('', views.api_root, name='assesments-home'),
path('assesments/', views.AssesmentList.as_view(), name='assesment-lis... | none | 1 | 2.24528 | 2 | |
runNomadDocker.py | csawyerYumaed/nomad-docker | 11 | 6629954 | <filename>runNomadDocker.py
#!/usr/bin/python -u
"""
nomad docker doesn't allow us to do volumes, which hurts.
This is a work-around. I hope they get their act together soon.
all META keys are capitalized by NOMAD, so be sure to define your _LABELS as uppercase.
required keys:
IMAGE -- name of the docker image to pu... | <filename>runNomadDocker.py
#!/usr/bin/python -u
"""
nomad docker doesn't allow us to do volumes, which hurts.
This is a work-around. I hope they get their act together soon.
all META keys are capitalized by NOMAD, so be sure to define your _LABELS as uppercase.
required keys:
IMAGE -- name of the docker image to pu... | en | 0.783632 | #!/usr/bin/python -u nomad docker doesn't allow us to do volumes, which hurts. This is a work-around. I hope they get their act together soon. all META keys are capitalized by NOMAD, so be sure to define your _LABELS as uppercase. required keys: IMAGE -- name of the docker image to pull. optional: REGISTRY_URL = th... | 2.327519 | 2 |
.venv/lib/python3.10/site-packages/lunr/pipeline.py | plocandido/docinfrati | 128 | 6629955 | <reponame>plocandido/docinfrati<gh_stars>100-1000
import logging
from typing import Callable, Dict
from lunr.exceptions import BaseLunrException
from lunr.token import Token
log = logging.getLogger(__name__)
class Pipeline:
"""lunr.Pipelines maintain a list of functions to be applied to all tokens
in docume... | import logging
from typing import Callable, Dict
from lunr.exceptions import BaseLunrException
from lunr.token import Token
log = logging.getLogger(__name__)
class Pipeline:
"""lunr.Pipelines maintain a list of functions to be applied to all tokens
in documents entering the search index and queries ran agai... | en | 0.767862 | lunr.Pipelines maintain a list of functions to be applied to all tokens in documents entering the search index and queries ran agains the index. # TODO: add iterator methods? Register a function with the pipeline. Loads a previously serialised pipeline. Adds new functions to the end of the pipeline. Functi... | 2.466331 | 2 |
funpackager/loader/jsonLoader.py | raojinlin/funpackager | 0 | 6629956 | import json
from funpackager.loader.abstractLoader import AbstractLoader
class JSONLoader(AbstractLoader):
def __init__(self, conf_file):
AbstractLoader.__init__(self, conf_file)
self._data = None
def get_data(self):
if not self._data:
self._data = json.load(open(self._c... | import json
from funpackager.loader.abstractLoader import AbstractLoader
class JSONLoader(AbstractLoader):
def __init__(self, conf_file):
AbstractLoader.__init__(self, conf_file)
self._data = None
def get_data(self):
if not self._data:
self._data = json.load(open(self._c... | none | 1 | 2.687084 | 3 | |
pages/extensions/internal_links/pod_internal_link_rewriter_test.py | psimyn/amp.dev | 1 | 6629957 | """Tests for the source code exporter."""
import unittest
import sys
import os
from grow.common.urls import Url
from grow.cache.object_cache import ObjectCache
sys.path.extend([os.path.join(os.path.dirname(__file__), '.')])
from pod_internal_link_rewriter import PodInternalLinkRewriter
class PodInternalLinkRewrite... | """Tests for the source code exporter."""
import unittest
import sys
import os
from grow.common.urls import Url
from grow.cache.object_cache import ObjectCache
sys.path.extend([os.path.join(os.path.dirname(__file__), '.')])
from pod_internal_link_rewriter import PodInternalLinkRewriter
class PodInternalLinkRewrite... | en | 0.3907 | Tests for the source code exporter. # two times the same url and different anchor to test possible cache problems #test">test</a><br>' \ #other">test2</a>' # two times the same url and different anchor to test possible cache problems #test">test</a><br>' \ #other">test2</a>' #test">test</a><br>' \ #other">test2</a>', r... | 2.435373 | 2 |
examples/11-camera/Camera.py | henkjannl/py-animate | 0 | 6629958 | from Animate import Animate
Animate.Model('Camera.xlsx', 'Main')
| from Animate import Animate
Animate.Model('Camera.xlsx', 'Main')
| none | 1 | 1.181914 | 1 | |
src/assistants/telegram.py | SmBe19/Todoistant | 0 | 6629959 | from datetime import datetime, timedelta
from utils import parse_task_config, run_every, run_next_in, local_to_utc
INIT_CONFIG = {
'chatid': 0,
'username': '',
'plain_labels': [],
'link_labels': [],
'forward_labels': [],
}
CONFIG_VERSION = 1
CONFIG_WHITELIST = [
'plain_project',
'plain_labels',
'link_project'... | from datetime import datetime, timedelta
from utils import parse_task_config, run_every, run_next_in, local_to_utc
INIT_CONFIG = {
'chatid': 0,
'username': '',
'plain_labels': [],
'link_labels': [],
'forward_labels': [],
}
CONFIG_VERSION = 1
CONFIG_WHITELIST = [
'plain_project',
'plain_labels',
'link_project'... | none | 1 | 2.420144 | 2 | |
docs/generate.py | EgorDm/notionsci | 13 | 6629960 | <gh_stars>10-100
"""Generate virtual files for mkdocs."""
import mkdocs_gen_files
def docs_stub(module_name):
return f"::: notionsci.{module_name}\
\n\trendering:\n\t\tshow_root_heading: true\n\t\tshow_source: true"
virtual_files = {
"index.md": "--8<-- 'README.md'",
# "reference/config.md": do... | """Generate virtual files for mkdocs."""
import mkdocs_gen_files
def docs_stub(module_name):
return f"::: notionsci.{module_name}\
\n\trendering:\n\t\tshow_root_heading: true\n\t\tshow_source: true"
virtual_files = {
"index.md": "--8<-- 'README.md'",
# "reference/config.md": docs_stub("config")... | en | 0.354047 | Generate virtual files for mkdocs. # "reference/config.md": docs_stub("config"), | 2.459982 | 2 |
warehouse_cloud/cloud/warehouse.py | 2021-SE-Lab-Mindstorm-Project/Smart-Warehouse-Cloud | 0 | 6629961 | from . import rl
from .models import Inventory, Order
class Warehouse:
def __init__(self, anomaly_aware):
# config
self.cap_conveyor = 5
self.cap_wait = 5
self.reward_order = 30
self.reward_trash = 70
self.reward_wait = 1
self.order_total = 20
self... | from . import rl
from .models import Inventory, Order
class Warehouse:
def __init__(self, anomaly_aware):
# config
self.cap_conveyor = 5
self.cap_wait = 5
self.reward_order = 30
self.reward_trash = 70
self.reward_wait = 1
self.order_total = 20
self... | en | 0.453361 | # config # Warehouse | 2.542484 | 3 |
run.py | zjlbzf/MNIST-test | 0 | 6629962 | <gh_stars>0
import threading
import os
def process():
os.sys('conda activate py3.7')
os.sys('G:\code\Projects\AI\Competation\Kaggle\003_MNIST> & D:/ProgramData/Anaconda3/envs/py3.7/python.exe g:/code/Projects/AI/Competation/Kaggle/003_MNIST/tf_MNIST.py')
for i in range(3):
t1 = threading.Thread(target=p... | import threading
import os
def process():
os.sys('conda activate py3.7')
os.sys('G:\code\Projects\AI\Competation\Kaggle\003_MNIST> & D:/ProgramData/Anaconda3/envs/py3.7/python.exe g:/code/Projects/AI/Competation/Kaggle/003_MNIST/tf_MNIST.py')
for i in range(3):
t1 = threading.Thread(target=process, args... | none | 1 | 2.196281 | 2 | |
helixswarm/adapters/aio.py | pbelskiy/helix-swarm | 2 | 6629963 | <filename>helixswarm/adapters/aio.py
import asyncio
from typing import Any, Callable, Optional, Union
from aiohttp import (
BasicAuth,
ClientError,
ClientResponse,
ClientSession,
ClientTimeout,
)
from helixswarm.swarm import Response, Swarm, SwarmError
class RetryClientSession:
def __init_... | <filename>helixswarm/adapters/aio.py
import asyncio
from typing import Any, Callable, Optional, Union
from aiohttp import (
BasicAuth,
ClientError,
ClientResponse,
ClientSession,
ClientTimeout,
)
from helixswarm.swarm import Response, Swarm, SwarmError
class RetryClientSession:
def __init_... | en | 0.499065 | # type: Union[ClientSession, RetryClientSession] Swarm async client class. * url: ``str`` Url of Swarm server, must include API version. * user: ``str`` User name, login. * password: ``str`` Password for user. * loop: ``AbstractEventLoop`` (optional) ... | 2.420816 | 2 |
setup.py | jd-boyd/HowLong | 17 | 6629964 | from setuptools import setup, find_packages
setup(author='<NAME>',
description='A simple timing utility for long running processes',
name='howlong',
py_modules=[
'HowLong.HowLong',
],
packages=find_packages(),
entry_points={
'console_scripts': [
... | from setuptools import setup, find_packages
setup(author='<NAME>',
description='A simple timing utility for long running processes',
name='howlong',
py_modules=[
'HowLong.HowLong',
],
packages=find_packages(),
entry_points={
'console_scripts': [
... | none | 1 | 1.296488 | 1 | |
api/src/tests/application/functional_tests/housing_units/test_endpoints.py | iliaskaras/housing-units | 0 | 6629965 | <gh_stars>0
import pytest
from fastapi.testclient import TestClient
from tests.application.functional_tests.housing_units.utils import get_cleaned_housing_units_response
from application.main import app
client = TestClient(app)
@pytest.mark.asyncio
async def test_filter_housing_units_get_request(
populate_u... | import pytest
from fastapi.testclient import TestClient
from tests.application.functional_tests.housing_units.utils import get_cleaned_housing_units_response
from application.main import app
client = TestClient(app)
@pytest.mark.asyncio
async def test_filter_housing_units_get_request(
populate_users, popula... | en | 0.914375 | # Remove project_id which is required. # Add a wrong formatted date to date fields. # Add string to integer and float fields. # Remove project_id which is required. # Add a wrong formatted date to date fields. # Add string to integer and float fields. | 2.445397 | 2 |
Source/PW2_main.py | xaviercucurull/sel-forests | 0 | 6629966 | """
Supervised and Experiential Learning (SEL)
Master in Artificial Intelligence (UPC)
PW2 - Implementation of a Decision Forest and Random Forest
Author: <NAME> <<EMAIL>>
Course: 2020/2021
"""
import sys
import os
sys.path.append(os.path.abspath(r'..'))
import pandas as pd
import time
import math
from sklearn.metri... | """
Supervised and Experiential Learning (SEL)
Master in Artificial Intelligence (UPC)
PW2 - Implementation of a Decision Forest and Random Forest
Author: <NAME> <<EMAIL>>
Course: 2020/2021
"""
import sys
import os
sys.path.append(os.path.abspath(r'..'))
import pandas as pd
import time
import math
from sklearn.metri... | de | 0.357528 | Supervised and Experiential Learning (SEL) Master in Artificial Intelligence (UPC) PW2 - Implementation of a Decision Forest and Random Forest Author: <NAME> <<EMAIL>> Course: 2020/2021 # Load Heart Disease database from CSV # https://www.kaggle.com/ronitf/heart-disease-uci ############################################... | 3.318381 | 3 |
maskrcnn_benchmark/structures/image_list.py | pwllr/IDA-3D | 78 | 6629967 | <gh_stars>10-100
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from __future__ import division
import torch
class ImageList(object):
"""
Structure that holds a list of images (of possibly
varying sizes) as a single tensor.
This works by padding the images to the same size,
... | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from __future__ import division
import torch
class ImageList(object):
"""
Structure that holds a list of images (of possibly
varying sizes) as a single tensor.
This works by padding the images to the same size,
and storing in... | en | 0.870339 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. Structure that holds a list of images (of possibly varying sizes) as a single tensor. This works by padding the images to the same size, and storing in a field the original sizes of each image Arguments: tensors (tensor) ... | 2.91487 | 3 |
motor_bundle/__init__.py | applauncher-team/motor-bundle | 0 | 6629968 | <reponame>applauncher-team/motor-bundle
from .bundle import MotorBundle
| from .bundle import MotorBundle | none | 1 | 1.184517 | 1 | |
apple/jwt_apple_signin.py | ranadeepmitra21/WeVoteServer_Ranadeep | 44 | 6629969 | <reponame>ranadeepmitra21/WeVoteServer_Ranadeep
import jwt
from jwt.algorithms import RSAAlgorithm
import requests
from time import time
import json
# import os
from config.base import get_environment_variable
APPLE_PUBLIC_KEY_URL = "https://appleid.apple.com/auth/keys"
APPLE_PUBLIC_KEY = None
APPLE_KEY_CACHE_EXP = 6... | import jwt
from jwt.algorithms import RSAAlgorithm
import requests
from time import time
import json
# import os
from config.base import get_environment_variable
APPLE_PUBLIC_KEY_URL = "https://appleid.apple.com/auth/keys"
APPLE_PUBLIC_KEY = None
APPLE_KEY_CACHE_EXP = 60 * 60 * 24
APPLE_LAST_KEY_FETCH = 0
# https://... | en | 0.778512 | # import os # https://gist.github.com/davidhariri/b053787aabc9a8a9cc0893244e1549fe # TODO: Question - could we change the name of this class so it doesn't conflict with the AppleUser in models.py? # Check to see if the public key is unset or is stale before returning # token = jwt.decode(apple_user_token, public_key, a... | 2.71324 | 3 |
tests/conftest.py | n-wbrown/pytpy | 0 | 6629970 | import logging
import pathlib
import pytest
import pytmc
from pytmc import linter, parser
logger = logging.getLogger(__name__)
TEST_PATH = pathlib.Path(__file__).parent
DBD_FILE = TEST_PATH / 'ads.dbd'
TMC_ROOT = TEST_PATH / 'tmc_files'
TMC_FILES = list(TMC_ROOT.glob('*.tmc'))
INVALID_TMC_FILES = list((TMC_ROOT / ... | import logging
import pathlib
import pytest
import pytmc
from pytmc import linter, parser
logger = logging.getLogger(__name__)
TEST_PATH = pathlib.Path(__file__).parent
DBD_FILE = TEST_PATH / 'ads.dbd'
TMC_ROOT = TEST_PATH / 'tmc_files'
TMC_FILES = list(TMC_ROOT.glob('*.tmc'))
INVALID_TMC_FILES = list((TMC_ROOT / ... | en | 0.725882 | generic .tmc file generic .tmc file .tmc file containing pinned global variables | 2.18342 | 2 |
tests/test_reference.py | Nightfurex/build-magic | 10 | 6629971 | """This module hosts unit tests for the reference module."""
import math
import pytest
from build_magic.exc import ValidationError
from build_magic.reference import EnumExt, Parameter
def test_parameter():
"""Verify the Parameter class works correctly."""
class Test(Parameter):
KEY = 'test'
... | """This module hosts unit tests for the reference module."""
import math
import pytest
from build_magic.exc import ValidationError
from build_magic.reference import EnumExt, Parameter
def test_parameter():
"""Verify the Parameter class works correctly."""
class Test(Parameter):
KEY = 'test'
... | en | 0.707071 | This module hosts unit tests for the reference module. Verify the Parameter class works correctly. # Make sure that changing KEY doesn't affect the internal key of a Parameter object. Verify the Parameter class with an alias works correctly. Verify the Parameter class with a default works correctly. Verify the Paramete... | 2.804728 | 3 |
pyro/distributions/unit.py | ludkinm/pyro | 0 | 6629972 | <gh_stars>0
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import torch
from torch.distributions import constraints
from pyro.distributions.torch_distribution import TorchDistribution
from pyro.distributions.util import broadcast_shape
class Unit(TorchDistribution):
"""
... | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import torch
from torch.distributions import constraints
from pyro.distributions.torch_distribution import TorchDistribution
from pyro.distributions.util import broadcast_shape
class Unit(TorchDistribution):
"""
Trivial ... | en | 0.6316 | # Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 Trivial nonnormalized distribution representing the unit type. The unit type has a single value with no data, i.e. ``value.numel() == 0``. This is used for :func:`pyro.factor` statements. # This satisfies .numel() == 0. | 2.389423 | 2 |
cogs/help.py | GamerGG1/Roblox-Discord-Bot | 1 | 6629973 | <gh_stars>1-10
import discord
from discord.ext import commands
from datetime import datetime
def setup(bot):
bot.add_cog(Help(bot))
class Help(commands.Cog):
def __init__(self,bot):
self.bot = bot
def get_commands(self):
helptext = []
for command in self.bot.commands:
... | import discord
from discord.ext import commands
from datetime import datetime
def setup(bot):
bot.add_cog(Help(bot))
class Help(commands.Cog):
def __init__(self,bot):
self.bot = bot
def get_commands(self):
helptext = []
for command in self.bot.commands:
if command.hi... | none | 1 | 2.796157 | 3 | |
process/helpers/__init__.py | ml-boringtao/mlp | 0 | 6629974 | from .csvhdf5dataset import CSVDatasetWriter, CSVDatasetReader | from .csvhdf5dataset import CSVDatasetWriter, CSVDatasetReader | none | 1 | 1.106368 | 1 | |
masar_optimal/custom/sales_invoice/sales_invoice.py | karamakcsc/masar_optimal | 0 | 6629975 | <filename>masar_optimal/custom/sales_invoice/sales_invoice.py
from __future__ import unicode_literals
import frappe, erpnext
import json
from frappe.utils import flt, cstr, nowdate, comma_and
from frappe import throw, msgprint, _
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
fr... | <filename>masar_optimal/custom/sales_invoice/sales_invoice.py
from __future__ import unicode_literals
import frappe, erpnext
import json
from frappe.utils import flt, cstr, nowdate, comma_and
from frappe import throw, msgprint, _
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
fr... | en | 0.572892 | Select tpii.rate as rate
from `tabSales Invoice Item` tpii
Inner Join `tabSales Invoice` tpi On tpii.parent = tpi.name
where tpii.item_code = '%s' and tpi.docstatus = 1
order By tpii.creation DESC
... | 1.829443 | 2 |
plugins/wazuh_ossec/komand_wazuh_ossec/actions/agent_restart/action.py | lukaszlaszuk/insightconnect-plugins | 46 | 6629976 | <reponame>lukaszlaszuk/insightconnect-plugins<gh_stars>10-100
import komand
from .schema import AgentRestartInput, AgentRestartOutput
# Custom imports below
import json
import requests
class AgentRestart(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="agent_res... | import komand
from .schema import AgentRestartInput, AgentRestartOutput
# Custom imports below
import json
import requests
class AgentRestart(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="agent_restart",
description="Restarts all agents, or a spec... | en | 0.854742 | # Custom imports below # Rename key to meet spec # Example must match spec to succeed due to required's | 2.114073 | 2 |
tests/nft20/conftest.py | Amirh24/cross-asset-swap | 1 | 6629977 | <reponame>Amirh24/cross-asset-swap<filename>tests/nft20/conftest.py
import pytest
from brownie import *
@pytest.fixture(scope="module", autouse=True)
def user(deployer):
return TestSwap.deploy(deployer)
@pytest.fixture(scope="module", autouse=True)
def deployer():
return {'from': accounts[1]}
@pytest.fixture(s... | import pytest
from brownie import *
@pytest.fixture(scope="module", autouse=True)
def user(deployer):
return TestSwap.deploy(deployer)
@pytest.fixture(scope="module", autouse=True)
def deployer():
return {'from': accounts[1]}
@pytest.fixture(scope="module", autouse=True)
def blockartNft():
return Contract(... | none | 1 | 1.905525 | 2 | |
src/samples/test.py | DanEdens/azure-devops-python-samples | 65 | 6629978 | <reponame>DanEdens/azure-devops-python-samples<gh_stars>10-100
"""
TEST samples
"""
import datetime
import logging
from samples import resource
from utils import emit
logger = logging.getLogger(__name__)
def get_project_names(context):
core_client = context.connection.clients.get_core_client()
return (proj... | """
TEST samples
"""
import datetime
import logging
from samples import resource
from utils import emit
logger = logging.getLogger(__name__)
def get_project_names(context):
core_client = context.connection.clients.get_core_client()
return (project.name for project in core_client.get_projects())
@resource... | en | 0.825337 | TEST samples # Limiting Test Results is not something one shall do! | 2.328908 | 2 |
tests/test_distribution.py | josephsnyder/CastXML-python-distributions | 0 | 6629979 | <reponame>josephsnyder/CastXML-python-distributions
import os
import pytest
from path import Path
DIST_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../dist'))
def _check_castxml_install(virtualenv, tmpdir):
expected_version = "0.3.4"
for executable_name in ["castxml"]:
output = v... | import os
import pytest
from path import Path
DIST_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../dist'))
def _check_castxml_install(virtualenv, tmpdir):
expected_version = "0.3.4"
for executable_name in ["castxml"]:
output = virtualenv.run(
"%s --version" % executabl... | none | 1 | 2.324274 | 2 | |
static_count/run.py | JiangYee/key_phrase_extract | 1 | 6629980 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import numpy as np
import pandas as pd
import time
from pandas.core.frame import DataFrame
from nltk import ngrams
from nltk.text import TextCollection
from static_count import preprocess, count, tf_idf, draw
json_file = '../data/test_json'
# json_file = '... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import numpy as np
import pandas as pd
import time
from pandas.core.frame import DataFrame
from nltk import ngrams
from nltk.text import TextCollection
from static_count import preprocess, count, tf_idf, draw
json_file = '../data/test_json'
# json_file = '... | en | 0.230682 | #!/usr/bin/env python # -*- coding: utf-8 -*- # json_file = '../data/all_title_abstract_keyword_clean.json' # print(keyword_list[144]) # print(len(keyword_list[144])) # print(len(keyword_list)) # # 统计关键词in or not in # count_results = count.count_in_all(abstract_list, keyword_list, isPart=False,isStem=False, isAnd=False... | 2.557335 | 3 |
Hapi/calibration.py | juancotrino/Hapi | 0 | 6629981 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Calibration
calibration contains functions to to connect the parameter spatial distribution
function with the with both component of the spatial representation of the hydrological
process (conceptual model & spatial routing) to calculate the performance of predicted
runoff at kn... | # -*- coding: utf-8 -*-
"""
Calibration
calibration contains functions to to connect the parameter spatial distribution
function with the with both component of the spatial representation of the hydrological
process (conceptual model & spatial routing) to calculate the performance of predicted
runoff at known location... | en | 0.60746 | # -*- coding: utf-8 -*- Calibration calibration contains functions to to connect the parameter spatial distribution function with the with both component of the spatial representation of the hydrological process (conceptual model & spatial routing) to calculate the performance of predicted runoff at known locations ba... | 2.80424 | 3 |
python/blazingdb/protocol/io/__init__.py | HubBucket-Team/blazingdb-protocol | 1 | 6629982 | import flatbuffers
import copy
import numpy
import blazingdb.protocol.transport as transport
from blazingdb.messages.blazingdb.protocol.io \
import FileSystemRegisterRequest, FileSystemDeregisterRequest, HDFS, S3, POSIX, CsvFile, ParquetFile
from blazingdb.messages.blazingdb.protocol.io import DriverType, Encrypti... | import flatbuffers
import copy
import numpy
import blazingdb.protocol.transport as transport
from blazingdb.messages.blazingdb.protocol.io \
import FileSystemRegisterRequest, FileSystemDeregisterRequest, HDFS, S3, POSIX, CsvFile, ParquetFile
from blazingdb.messages.blazingdb.protocol.io import DriverType, Encrypti... | en | 0.464304 | #todo, crear mappers para unions, see union_segment #todo, crear mappers para unions #todo, crear mappers para unions, see union_segment # check if it is enum # check if it is enum | 2.317106 | 2 |
test/rules/provider_test.bzl | liuliu/rules_swift | 215 | 6629983 | # Copyright 2019 The Bazel Authors. All rights reserved.
#
# 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 la... | # Copyright 2019 The Bazel Authors. All rights reserved.
#
# 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 la... | en | 0.882727 | # Copyright 2019 The Bazel Authors. All rights reserved. # # 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 la... | 1.861793 | 2 |
DataPrev/joinAll.py | TRBaldim/Spark | 0 | 6629984 | #Version 0.0.0
def getEvents (a, b):
try:
return a.append(b[0])
except:
return a
def filterByEvent (line):
try:
if str(line[2]).strip() != '':
return (str(line[1]).strip(), str(line[2]).strip() + ";" +str(line[0]).strip())
elif str(line[3]).strip() != '':
return (str(line[1]).strip(), str(line[3]).st... | #Version 0.0.0
def getEvents (a, b):
try:
return a.append(b[0])
except:
return a
def filterByEvent (line):
try:
if str(line[2]).strip() != '':
return (str(line[1]).strip(), str(line[2]).strip() + ";" +str(line[0]).strip())
elif str(line[3]).strip() != '':
return (str(line[1]).strip(), str(line[3]).st... | pt | 0.603539 | #Version 0.0.0 #ID_PF, Data_Alteracao, Data_Divorcio, Inconcistencia CERTIDOES_CIVIS_PART #Retorno da Linha: [[id_certidao_civil, id_pessoa_fisica, dt_evento, dt_emissao, dt_separacao, dt_divorcio]] #Retorno [('1027040844', 'Inc.'), ('1665214649', '1976-12-08;155259490')] -> (PF_ID, 'data mais recente entre dt_evento ... | 2.796461 | 3 |
react/reactLexer.py | caos21/test-ode | 1 | 6629985 | # Generated from react.g4 by ANTLR 4.6
from antlr4 import *
from io import StringIO
def serializedATN():
with StringIO() as buf:
buf.write("\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\16")
buf.write("k\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
buf.write("\4\b\t\b\4\t\t... | # Generated from react.g4 by ANTLR 4.6
from antlr4 import *
from io import StringIO
def serializedATN():
with StringIO() as buf:
buf.write("\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\16")
buf.write("k\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
buf.write("\4\b\t\b\4\t\t... | es | 0.246638 | # Generated from react.g4 by ANTLR 4.6 #\16\3\2\7\4\2\f\f\17\17\4\2C\\c|\t\2%%") #\3\2\2\2\3%\3\2\2\2\5,\3\2\2\2\7.") #g\3\2\2\2%)\7%\2\2&(\n\2\2\2\'&\3\2\2\2(+\3\2\2\2)") | 1.288764 | 1 |
corehq/motech/repeaters/views/repeaters.py | akyogi/commcare-hq | 0 | 6629986 | <filename>corehq/motech/repeaters/views/repeaters.py
import json
from collections import namedtuple
from django.contrib import messages
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.translation ... | <filename>corehq/motech/repeaters/views/repeaters.py
import json
from collections import namedtuple
from django.contrib import messages
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.translation ... | en | 0.754077 | # The EditRepeaterView url routes to the correct edit form for its subclasses. It does this with # `repeater_type` in r'^forwarding/(?P<repeater_type>\w+)/edit/(?P<repeater_id>\w+)/$' # See corehq/apps/domain/urls.py for details. | 1.668187 | 2 |
Code(2021)/20210116_Thor_NAMA.py | std-freejia/hymni.study | 1 | 6629987 | import sys
import math
import numpy as np
light_x, light_y, initial_tx, initial_ty = [int(i) for i in input().split()]
# 현재 위치를 기준으로 light의 사분면 파악하기
remain_x = light_x - initial_tx
remain_y = light_y - initial_ty
dir_arr = ['N','S','E','W','']
val_arr = [[0,1], [0,-1], [1,0], [-1,0], [0,0]]
# game loop
whil... | import sys
import math
import numpy as np
light_x, light_y, initial_tx, initial_ty = [int(i) for i in input().split()]
# 현재 위치를 기준으로 light의 사분면 파악하기
remain_x = light_x - initial_tx
remain_y = light_y - initial_ty
dir_arr = ['N','S','E','W','']
val_arr = [[0,1], [0,-1], [1,0], [-1,0], [0,0]]
# game loop
whil... | ko | 0.949588 | # 현재 위치를 기준으로 light의 사분면 파악하기 # game loop # The remaining amount of turns Thor can move. Do not remove this line. # True인 값만 찾아 index 가져오기 | 2.951753 | 3 |
picmodels/migrations/0051_healthcareserviceexpertise.py | bbcawodu/careadvisors-backend | 0 | 6629988 | <filename>picmodels/migrations/0051_healthcareserviceexpertise.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('picmodels', '0050_auto_20180306_1502'),
]
operations = [
m... | <filename>picmodels/migrations/0051_healthcareserviceexpertise.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('picmodels', '0050_auto_20180306_1502'),
]
operations = [
m... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.625984 | 2 |
trying_curses.py | Adel-Charef/scripts | 0 | 6629989 | import curses
import time
screen = curses.initscr()
screen.addstr(4, 10, "Hello from (4, 10)!")
screen.refresh()
time.sleep(2)
curses.endwin()
| import curses
import time
screen = curses.initscr()
screen.addstr(4, 10, "Hello from (4, 10)!")
screen.refresh()
time.sleep(2)
curses.endwin()
| none | 1 | 2.409385 | 2 | |
login.py | nslm/Api-Portal-do-Aluno | 0 | 6629990 | import re
import werkzeug
werkzeug.cached_property = werkzeug.utils.cached_property
from robobrowser import RoboBrowser
def Login(matricula,senha):
url = 'https://portalence.ibge.gov.br/gcad-aluno/'
br = RoboBrowser()
br.open(url)
form = br.get_form()
form['login-form:matricula-... | import re
import werkzeug
werkzeug.cached_property = werkzeug.utils.cached_property
from robobrowser import RoboBrowser
def Login(matricula,senha):
url = 'https://portalence.ibge.gov.br/gcad-aluno/'
br = RoboBrowser()
br.open(url)
form = br.get_form()
form['login-form:matricula-... | none | 1 | 2.423797 | 2 | |
ansible/my_env/lib/python2.7/site-packages/ansible/plugins/callback/dense.py | otus-devops-2019-02/yyashkin_infra | 1 | 6629991 | <gh_stars>1-10
# (c) 2016, <NAME> <<EMAIL>>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: dense
type: stdout
short_description... | # (c) 2016, <NAME> <<EMAIL>>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: dense
type: stdout
short_description: minimal stdou... | en | 0.813758 | # (c) 2016, <NAME> <<EMAIL>> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) callback: dense type: stdout short_description: minimal stdout output extends_documentation_fragment: - default_callback description: - When in verbose mode it will act th... | 1.78408 | 2 |
kitsune/users/migrations/0019_auto_20190917_0422.py | AndrewDVXI/kitsune | 929 | 6629992 | <reponame>AndrewDVXI/kitsune
# -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-09-17 04:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0004_product_codename'),
('users', '0018_c... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-09-17 04:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0004_product_codename'),
('users', '0018_change_bn_BD_and_bn_IN_to_bn')... | en | 0.689663 | # -*- coding: utf-8 -*- # Generated by Django 1.11.22 on 2019-09-17 04:22 | 1.542094 | 2 |
src/generate_answer.py | EmmanuelMess/SNLI-NLP-ECI-2019 | 2 | 6629993 | #!/usr/bin/env python
import argparse
import json
import csv
def generate():
"Junta el archivo con las oraciones de test (jsonl)"
" y los resultados de la clasificación de tu algoritmo (en tu formato)"
" en un archivo csv compatible con el formato de Kaggle"
sentences_filename = ".data/snli_1.0_test_f... | #!/usr/bin/env python
import argparse
import json
import csv
def generate():
"Junta el archivo con las oraciones de test (jsonl)"
" y los resultados de la clasificación de tu algoritmo (en tu formato)"
" en un archivo csv compatible con el formato de Kaggle"
sentences_filename = ".data/snli_1.0_test_f... | es | 0.398079 | #!/usr/bin/env python # sacamos el fin de linea | 3.131674 | 3 |
src/orders/services/order_shipper.py | vaibhavantil2/education-backend | 151 | 6629994 | <gh_stars>100-1000
from django.conf import settings
from django.utils import timezone
from app.tasks import send_happiness_message, send_mail
from orders.models import Order
class OrderShipper:
"""Ship the order (actualy calls item ship() method)"""
def __init__(self, order: Order, silent: bool = False):
... | from django.conf import settings
from django.utils import timezone
from app.tasks import send_happiness_message, send_mail
from orders.models import Order
class OrderShipper:
"""Ship the order (actualy calls item ship() method)"""
def __init__(self, order: Order, silent: bool = False):
self.order = o... | en | 0.725985 | Ship the order (actualy calls item ship() method) Ship the order. Returns true if order is shipped # postmark | 2.45441 | 2 |
setup.py | okcashpro/okshop | 3 | 6629995 | <filename>setup.py<gh_stars>1-10
import os
from setuptools import find_packages, setup
from pip.req import parse_requirements
# TODO: Fix nasty hack ;_;
install_reqs = parse_requirements(os.path.join(os.path.dirname(__file__), 'requirements.txt'), session='hack')
reqs = [str(ir.req) for ir in install_reqs]
wi... | <filename>setup.py<gh_stars>1-10
import os
from setuptools import find_packages, setup
from pip.req import parse_requirements
# TODO: Fix nasty hack ;_;
install_reqs = parse_requirements(os.path.join(os.path.dirname(__file__), 'requirements.txt'), session='hack')
reqs = [str(ir.req) for ir in install_reqs]
wi... | es | 0.238519 | # TODO: Fix nasty hack ;_; | 1.803246 | 2 |
verif/metric_type.py | yma042/verif | 77 | 6629996 | import sys
import inspect
class MetricType(object):
def __eq__(self, other):
return self.__class__ == other.__class__
def __ne__(self, other):
return not self.__eq__(other)
@classmethod
def name(cls):
name = cls.__name__
return name
class Deterministic(MetricType):
... | import sys
import inspect
class MetricType(object):
def __eq__(self, other):
return self.__class__ == other.__class__
def __ne__(self, other):
return not self.__eq__(other)
@classmethod
def name(cls):
name = cls.__name__
return name
class Deterministic(MetricType):
... | none | 1 | 2.931132 | 3 | |
setup.py | jaketreacher/host_open | 0 | 6629997 | from setuptools import setup, Command
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as file:
long_description = file.read()
setup(
name='hostopen',
version='0.1.1',
description='Open files/directories... | from setuptools import setup, Command
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as file:
long_description = file.read()
setup(
name='hostopen',
version='0.1.1',
description='Open files/directories... | none | 1 | 1.584973 | 2 | |
util/chplenv/chpl_wide_pointers.py | TomsyPaul/tomsychapel | 1 | 6629998 | <reponame>TomsyPaul/tomsychapel
#!/usr/bin/env python
import optparse
import os
import re
import sys
chplenv_dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.abspath(chplenv_dir))
import overrides
from utils import memoize
@memoize
def get(flag='wide'):
wide_val = overrides.get('CHPL_WIDE_POINTERS', '... | #!/usr/bin/env python
import optparse
import os
import re
import sys
chplenv_dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.abspath(chplenv_dir))
import overrides
from utils import memoize
@memoize
def get(flag='wide'):
wide_val = overrides.get('CHPL_WIDE_POINTERS', 'struct')
define = ''
if... | ru | 0.26433 | #!/usr/bin/env python | 2.302363 | 2 |
setup.py | nwtti/rainbowstream | 1 | 6629999 | from setuptools import setup, find_packages
import os
import os.path
# Bumped version
version = '1.2.3'
# Require
install_requires = [
"python-dateutil",
"arrow",
"requests",
"pyfiglet",
"twitter",
"Pillow",
"PySocks"
]
# Copy default config if not exists
default = os.path.expanduser("~")... | from setuptools import setup, find_packages
import os
import os.path
# Bumped version
version = '1.2.3'
# Require
install_requires = [
"python-dateutil",
"arrow",
"requests",
"pyfiglet",
"twitter",
"Pillow",
"PySocks"
]
# Copy default config if not exists
default = os.path.expanduser("~")... | en | 0.413156 | # Bumped version # Require # Copy default config if not exists # Setup # -*- Entry points: -*- [console_scripts] rainbowstream=rainbowstream.rainbow:fly | 1.817553 | 2 |
plantcv/plantcv/hyperspectral/extract_index.py | JamesChooWK/plantcv | 0 | 6630000 | <filename>plantcv/plantcv/hyperspectral/extract_index.py
# Extract one of the predefined indices from a hyperspectral datacube
import os
import numpy as np
from plantcv.plantcv import params
from plantcv.plantcv import plot_image
from plantcv.plantcv import print_image
from plantcv.plantcv import fatal_error
from plan... | <filename>plantcv/plantcv/hyperspectral/extract_index.py
# Extract one of the predefined indices from a hyperspectral datacube
import os
import numpy as np
from plantcv.plantcv import params
from plantcv.plantcv import plot_image
from plantcv.plantcv import print_image
from plantcv.plantcv import fatal_error
from plan... | en | 0.709746 | # Extract one of the predefined indices from a hyperspectral datacube Pull out indices of interest from a hyperspectral datacube. Inputs: array = hyperspectral data instance index = index of interest, either "ndvi", "gdvi", or "savi" distance = how lenient to be if the required waveleng... | 2.998292 | 3 |
modality/util/ClustData.py | tompollard/modality | 16 | 6630001 | <reponame>tompollard/modality<filename>modality/util/ClustData.py
from __future__ import unicode_literals
from collections import Counter
import matplotlib.colors as colors
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import gaussian_kde
from . import MC_error_check
class ClustData(object):
... | from __future__ import unicode_literals
from collections import Counter
import matplotlib.colors as colors
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import gaussian_kde
from . import MC_error_check
class ClustData(object):
'''
Object for handling clusters in data.
Can ... | en | 0.853537 | Object for handling clusters in data. Can find closest clusters in data set using Bhattacharyya distance. Check if most common label in k1 (by other labelings) is different from most common label in k2. #ax.set_ylim(0, 200) For finding a cluster that is common across a number of labe... | 2.586525 | 3 |
django_drf_filepond/uploaders.py | MarketingCannon/django-drf-filepond | 0 | 6630002 | import logging
import os
from django.core.files.uploadedfile import UploadedFile, InMemoryUploadedFile
from rest_framework import status
from rest_framework.exceptions import ParseError, MethodNotAllowed
from rest_framework.response import Response
from django_drf_filepond.models import TemporaryUpload, storage,\
... | import logging
import os
from django.core.files.uploadedfile import UploadedFile, InMemoryUploadedFile
from rest_framework import status
from rest_framework.exceptions import ParseError, MethodNotAllowed
from rest_framework.response import Response
from django_drf_filepond.models import TemporaryUpload, storage,\
... | en | 0.888115 | # There's no built in FileNotFoundError in Python 2 # Process the request to identify if it's a standard upload request # or a request that is related to a chunked upload. Return the right # kind of uploader to handle this. # If we didn't identify the need for a chunked uploader in any of the # above tests, treat this ... | 2.11818 | 2 |
guests/migrations/0020_alter_guest_meal.py | MarinaMcGrath/django-wedding-website | 0 | 6630003 | <filename>guests/migrations/0020_alter_guest_meal.py<gh_stars>0
# Generated by Django 4.0.1 on 2022-01-29 04:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('guests', '0019_party_display_name'),
]
operations = [
migrations.AlterField(... | <filename>guests/migrations/0020_alter_guest_meal.py<gh_stars>0
# Generated by Django 4.0.1 on 2022-01-29 04:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('guests', '0019_party_display_name'),
]
operations = [
migrations.AlterField(... | en | 0.857644 | # Generated by Django 4.0.1 on 2022-01-29 04:56 | 1.619657 | 2 |
src/api/v1/__init__.py | BuildForSDG/Team-115-Product | 0 | 6630004 | import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from dotenv import load_dotenv
application = Flask(__name__)
basedir = os.path.abspath(os.path.dirname(__file__)) # set db base directory
project_dir = os.path.expanduser('~/team-115-product')
load_dotenv(os.... | import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from dotenv import load_dotenv
application = Flask(__name__)
basedir = os.path.abspath(os.path.dirname(__file__)) # set db base directory
project_dir = os.path.expanduser('~/team-115-product')
load_dotenv(os.... | en | 0.678602 | # set db base directory # secret keys for forms & sessions # set the database uri #os.environ['DATABASE_URL'] # enable automatic commit of database changes at the end of each request # disable signaling the app anytime a database change is made # Bootstrap(app) # Resgister blueprints | 2.299396 | 2 |
pyteal/compiler/sort.py | CiottiGiorgio/pyteal | 0 | 6630005 | <reponame>CiottiGiorgio/pyteal<filename>pyteal/compiler/sort.py
from typing import List
from pyteal.ir import TealBlock
from pyteal.errors import TealInternalError
def sortBlocks(start: TealBlock, end: TealBlock) -> List[TealBlock]:
"""Topologically sort the graph which starts with the input TealBlock.
Args... | from typing import List
from pyteal.ir import TealBlock
from pyteal.errors import TealInternalError
def sortBlocks(start: TealBlock, end: TealBlock) -> List[TealBlock]:
"""Topologically sort the graph which starts with the input TealBlock.
Args:
start: The starting point of the graph to sort.
R... | en | 0.943845 | Topologically sort the graph which starts with the input TealBlock. Args: start: The starting point of the graph to sort. Returns: An ordered list of TealBlocks that is sorted such that every block is guaranteed to appear in the list before all of its outgoing blocks. # I changed visit... | 2.87246 | 3 |
app/pages/choices/unm.py | zferic/harmonization-website | 1 | 6630006 | CAT_UNM_ANALYTES = [('Analytes', (
('BCD', 'Cadmium - Blood'),
('BHGE', 'Ethyl Mercury - Blood'),
('BHGM', 'Methyl Mercury - Blood'),
('BMN', 'Manganese - Blood'),
('BPB', 'Lead - Blood'),
('BSE', 'Selenium - Blood'),
('IHG', 'Inorganic Mercury - Blood'),
('THG', 'Mercury Total - B... | CAT_UNM_ANALYTES = [('Analytes', (
('BCD', 'Cadmium - Blood'),
('BHGE', 'Ethyl Mercury - Blood'),
('BHGM', 'Methyl Mercury - Blood'),
('BMN', 'Manganese - Blood'),
('BPB', 'Lead - Blood'),
('BSE', 'Selenium - Blood'),
('IHG', 'Inorganic Mercury - Blood'),
('THG', 'Mercury Total - B... | en | 0.619707 | # all time periods ploted together #UNM_FEATURE_CHOICES = CAT_UNM_ANALYTES | 1.267251 | 1 |
scripts/_dparser.py | WinstonLHS/tofu | 56 | 6630007 | import sys
import os
import getpass
import argparse
# tofu
# test if in a tofu git repo
_HERE = os.path.abspath(os.path.dirname(__file__))
_TOFUPATH = os.path.dirname(_HERE)
def get_mods():
istofugit = False
if '.git' in os.listdir(_TOFUPATH) and 'tofu' in _TOFUPATH:
istofugit = True
if istofug... | import sys
import os
import getpass
import argparse
# tofu
# test if in a tofu git repo
_HERE = os.path.abspath(os.path.dirname(__file__))
_TOFUPATH = os.path.dirname(_HERE)
def get_mods():
istofugit = False
if '.git' in os.listdir(_TOFUPATH) and 'tofu' in _TOFUPATH:
istofugit = True
if istofug... | de | 0.327291 | # tofu # test if in a tofu git repo # Make sure we load the corresponding tofu # default parameters # Make sure we load the user-specific file # sys.path method # sys.path.insert(1, os.path.join(os.path.expanduser('~'), '.tofu')) # import _scripts_def as _defscripts # _ = sys.path.pop(1) # importlib method # ##########... | 2.268006 | 2 |
src/verify_ce_config.py | bbockelm/htcondor-ce | 0 | 6630008 | <filename>src/verify_ce_config.py
#!/bin/env python
"""
Verify HTCondor-CE configuration before service startup
"""
import re
import sys
# Verify that the HTCondor Python bindings are in the PYTHONPATH
try:
import classad
import htcondor
except ImportError:
sys.exit("ERROR: Could not load HTCondor Python... | <filename>src/verify_ce_config.py
#!/bin/env python
"""
Verify HTCondor-CE configuration before service startup
"""
import re
import sys
# Verify that the HTCondor Python bindings are in the PYTHONPATH
try:
import classad
import htcondor
except ImportError:
sys.exit("ERROR: Could not load HTCondor Python... | en | 0.761069 | #!/bin/env python Verify HTCondor-CE configuration before service startup # Verify that the HTCondor Python bindings are in the PYTHONPATH # Create dict whose values are lists of ads specified in the relevant JOB_ROUTER_* variables # store the ads (iterating through ClassAdStringIterator consumes them) # Verify job rou... | 2.420116 | 2 |
src/ocr/ocr_image.py | fgulan/PyOCR | 0 | 6630009 | import sys
import cv2
import numpy as np
from utils import hist
import imutils
from scipy.ndimage import interpolation as inter
class OCRImage:
MAX_ROTATE_ANGLE = 3
ANGLE_DELTA = 0.05
MAX_SCALED_DIMENSION = 800
def __init__(self, image, width, height, x_offset=0, y_offset=0):
self._image = ... | import sys
import cv2
import numpy as np
from utils import hist
import imutils
from scipy.ndimage import interpolation as inter
class OCRImage:
MAX_ROTATE_ANGLE = 3
ANGLE_DELTA = 0.05
MAX_SCALED_DIMENSION = 800
def __init__(self, image, width, height, x_offset=0, y_offset=0):
self._image = ... | en | 0.681967 | # Rotate image for given angle # Calculate horizontal projection # Calculate projection gradient # Add border so when image is rotated - black pixels will be filled | 2.46182 | 2 |
setup.py | aryamanarora/hindi | 0 | 6630010 | <reponame>aryamanarora/hindi
from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='hindi',
version='0.0.0',
description='Useful tools for dealing with Hindi',
long_description=readme,
author='... | from setuptools import setup, find_packages
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='hindi',
version='0.0.0',
description='Useful tools for dealing with Hindi',
long_description=readme,
author='<NAME>',
author_email='<E... | none | 1 | 1.228493 | 1 | |
setup.py | thiviyanT/torch-rgcn | 49 | 6630011 | from setuptools import setup
setup(name='torch-rgcn',
version='1.0',
description='A PyTorch library for Relational Graph Convolutional Networks',
url='https://github.com/thiviyanT/torch-RGCN',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
packages=['torch_rgcn'],
... | from setuptools import setup
setup(name='torch-rgcn',
version='1.0',
description='A PyTorch library for Relational Graph Convolutional Networks',
url='https://github.com/thiviyanT/torch-RGCN',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
packages=['torch_rgcn'],
... | none | 1 | 1.055237 | 1 | |
atlas/foundations_contrib/src/foundations_contrib/helpers/redis_connector.py | DeepLearnI/atlas | 296 | 6630012 |
class RedisConnector(object):
"""Acts as a callback for the LazyRedis class,
allowing it to be called directly without knowledge of
how configuring a Redis url works
Arguments:
config_manager {ConfigManager} -- A provider for the Redis connection string
connection_callback {callable} ... |
class RedisConnector(object):
"""Acts as a callback for the LazyRedis class,
allowing it to be called directly without knowledge of
how configuring a Redis url works
Arguments:
config_manager {ConfigManager} -- A provider for the Redis connection string
connection_callback {callable} ... | en | 0.660402 | Acts as a callback for the LazyRedis class, allowing it to be called directly without knowledge of how configuring a Redis url works Arguments: config_manager {ConfigManager} -- A provider for the Redis connection string connection_callback {callable} -- Callback to provide the connection s... | 3.346551 | 3 |
qtpyvcp/plugins/gcode_properties.py | robertspark/qtpyvcp | 0 | 6630013 | <reponame>robertspark/qtpyvcp
"""
GCodeProperties
--------
This plugin provides the information about sizes and times
This plugin is not loaded by default, so to use it you will first
need to add it to your VCPs YAML config file.
YAML configuration:
.. code-block:: yaml
data_plugins:
gcode_properties:
... | """
GCodeProperties
--------
This plugin provides the information about sizes and times
This plugin is not loaded by default, so to use it you will first
need to add it to your VCPs YAML config file.
YAML configuration:
.. code-block:: yaml
data_plugins:
gcode_properties:
provider: qtpyvcp.plugin... | en | 0.519702 | GCodeProperties -------- This plugin provides the information about sizes and times This plugin is not loaded by default, so to use it you will first need to add it to your VCPs YAML config file. YAML configuration: .. code-block:: yaml data_plugins: gcode_properties: provider: qtpyvcp.plugins.gc... | 2.308093 | 2 |
setup.py | deanle17/urlSigner | 0 | 6630014 | <gh_stars>0
from setuptools import setup
setup(
name='urlSigner',
version='0.0.3',
description='Library to sign a URL',
license='MIT',
packages=['urlSigner'],
author='deanle17',
author_email='<EMAIL>',
keywords=['url', 'signer'],
url='https://github.com/deanle17/fsecure-assignment',... | from setuptools import setup
setup(
name='urlSigner',
version='0.0.3',
description='Library to sign a URL',
license='MIT',
packages=['urlSigner'],
author='deanle17',
author_email='<EMAIL>',
keywords=['url', 'signer'],
url='https://github.com/deanle17/fsecure-assignment',
downloa... | none | 1 | 1.27672 | 1 | |
large_app/python/env.py | sahilGupta89/large_flask_app | 0 | 6630015 | import os
database="devdb"
user="devuser"
host="localhost"
password="password"
VERSION = os.environ.get("VERSION", "n/a")
DB_CONNECTION_STRING = os.environ.get(
"DB_CONNECTION_STRING", "mysql+pymysql://localhost:3306/dev"
)
PGDB_CONNECTION_STRING = os.environ.get(
"PGDB_CONNECTION_STRING", "postgresql+psycop... | import os
database="devdb"
user="devuser"
host="localhost"
password="password"
VERSION = os.environ.get("VERSION", "n/a")
DB_CONNECTION_STRING = os.environ.get(
"DB_CONNECTION_STRING", "mysql+pymysql://localhost:3306/dev"
)
PGDB_CONNECTION_STRING = os.environ.get(
"PGDB_CONNECTION_STRING", "postgresql+psycop... | en | 0.596434 | # Auth0 settings # Sentry # FREQ # FOR CHAMP Service # BMW Auth # JAG Auth | 1.91448 | 2 |
indico/modules/rb/operations/bookings.py | CrownedSilverFox/conference-platform | 1 | 6630016 | <filename>indico/modules/rb/operations/bookings.py
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from collections import defaultdict
from datetime impor... | <filename>indico/modules/rb/operations/bookings.py
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from collections import defaultdict
from datetime impor... | en | 0.920913 | # This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. Get events suitable for booking linking. This finds events that overlap with an occurrence of a bookin... | 1.619913 | 2 |
Stack/9-stack-sorting-with-recursion.py | mahmutcankurt/DataStructures_Python | 1 | 6630017 | <reponame>mahmutcankurt/DataStructures_Python<gh_stars>1-10
def insert(s, element):
if(len(s) == 0 or element > s[-1]):
s.append(element)
return
else:
temp = s.pop()
insert(s, element)
s.append(temp)
def sorting(s):
if(len(s) != 0):
temp = s.pop()
so... | def insert(s, element):
if(len(s) == 0 or element > s[-1]):
s.append(element)
return
else:
temp = s.pop()
insert(s, element)
s.append(temp)
def sorting(s):
if(len(s) != 0):
temp = s.pop()
sorting(s)
insert(s, temp)
def printStack(s):
for... | none | 1 | 4.116955 | 4 | |
functions/test/faceapi_test.py | yokawasa/facetag-functions | 2 | 6630018 | # -*- coding: utf-8 -*-
import glob,os,io
import sys
sys.path.append('../')
from commons.config import Config
from commons.faceapi import AzureCognitiveFaceAPI
from commons.blockblob import AzureStorageBlockBlob
config = Config()
# Face API
# pip install azure-cognitiveservices-vision-face
# FaceAPI Python SDK
# ht... | # -*- coding: utf-8 -*-
import glob,os,io
import sys
sys.path.append('../')
from commons.config import Config
from commons.faceapi import AzureCognitiveFaceAPI
from commons.blockblob import AzureStorageBlockBlob
config = Config()
# Face API
# pip install azure-cognitiveservices-vision-face
# FaceAPI Python SDK
# ht... | en | 0.376871 | # -*- coding: utf-8 -*- # Face API # pip install azure-cognitiveservices-vision-face # FaceAPI Python SDK # https://docs.microsoft.com/en-us/azure/cognitive-services/face/quickstarts/python-sdk # https://azure.microsoft.com/en-us/services/cognitive-services/face/ # https://github.com/Azure-Samples/cognitive-services-qu... | 2.203276 | 2 |
pymtl3/passes/backends/verilog/translation/behavioral/VBehavioralTranslatorL2.py | kevinyuan/pymtl3 | 152 | 6630019 | #=========================================================================
# VBehavioralTranslatorL2.py
#=========================================================================
# Author : <NAME>
# Date : March 18, 2019
"""Provide the level 2 SystemVerilog translator implementation."""
from pymtl3.passes.backends.g... | #=========================================================================
# VBehavioralTranslatorL2.py
#=========================================================================
# Author : <NAME>
# Date : March 18, 2019
"""Provide the level 2 SystemVerilog translator implementation."""
from pymtl3.passes.backends.g... | en | 0.144218 | #========================================================================= # VBehavioralTranslatorL2.py #========================================================================= # Author : <NAME> # Date : March 18, 2019 Provide the level 2 SystemVerilog translator implementation. #-----------------------------------... | 2.214565 | 2 |
mk_release.py | vika-sonne/blender-xray | 0 | 6630020 | #!/usr/bin/env python3
from io_scene_xray import bl_info
from zipfile import ZipFile, ZIP_DEFLATED
from os import path, walk
with ZipFile('blender-xray-' + ('.'.join(map(str, bl_info['version']))) + '.zip', 'w') as z:
z.write('LICENSE', 'io_scene_xray/LICENSE', compress_type=ZIP_DEFLATED)
for root, _, files i... | #!/usr/bin/env python3
from io_scene_xray import bl_info
from zipfile import ZipFile, ZIP_DEFLATED
from os import path, walk
with ZipFile('blender-xray-' + ('.'.join(map(str, bl_info['version']))) + '.zip', 'w') as z:
z.write('LICENSE', 'io_scene_xray/LICENSE', compress_type=ZIP_DEFLATED)
for root, _, files i... | fr | 0.221828 | #!/usr/bin/env python3 | 2.256592 | 2 |
ch4/hebberr_combo/hebberr_combo.py | CompCogNeuro/sims | 76 | 6630021 | <gh_stars>10-100
#!/usr/local/bin/pyleabra -i
# Copyright (c) 2019, The Emergent Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# use:
# just type file name to run, or:
# pyleabra -i <file>.py
# hebberr_combo shows how XCal hebbian... | #!/usr/local/bin/pyleabra -i
# Copyright (c) 2019, The Emergent Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# use:
# just type file name to run, or:
# pyleabra -i <file>.py
# hebberr_combo shows how XCal hebbian learning in shal... | en | 0.845848 | #!/usr/local/bin/pyleabra -i # Copyright (c) 2019, The Emergent Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # use: # just type file name to run, or: # pyleabra -i <file>.py # hebberr_combo shows how XCal hebbian learning in shallowe... | 1.929104 | 2 |
examples/example_mnist_prune.py | kshithijiyer/qkeras | 388 | 6630022 | # Copyright 2019 Google LLC
#
#
# 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,... | # Copyright 2019 Google LLC
#
#
# 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,... | en | 0.777163 | # Copyright 2019 Google LLC # # # 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,... | 2.073782 | 2 |
model/evaluator.py | Gofinge/HF | 7 | 6630023 | <reponame>Gofinge/HF
from .config import *
class Evaluator:
def __init__(self):
self._acc = 3
pass
def evaluate_trend_simple(self, y_true, y_pred):
size = len(y_true)
correct = 0
all = 0
for i in range(size):
if y_true[i] * y_pred[i] > 0 and y_true[... | from .config import *
class Evaluator:
def __init__(self):
self._acc = 3
pass
def evaluate_trend_simple(self, y_true, y_pred):
size = len(y_true)
correct = 0
all = 0
for i in range(size):
if y_true[i] * y_pred[i] > 0 and y_true[i] != 0:
... | zh | 0.954926 | # 预测价格不变,但实际价格变化,预测错误 # 预测价格改变,但实际价格不变,预测错误 # 预测价格变化趋势和实际价格变化趋势相同 # 预测价格变化趋势和实际价格变化趋势相反 | 3.187423 | 3 |
clu/scripts/legacy/xdg-runtime.py | fish2000/CLU | 1 | 6630024 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os, sys
SSID = os.getenv('SECURITYSESSIONID')
from clu.constants.consts import (DEBUG, HOSTNAME, XDG_RUNTIME_BASE,
XDG_RUNTIME_DIR,
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os, sys
SSID = os.getenv('SECURITYSESSIONID')
from clu.constants.consts import (DEBUG, HOSTNAME, XDG_RUNTIME_BASE,
XDG_RUNTIME_DIR,
... | en | 0.616878 | #!/usr/bin/env python # -*- coding: utf-8 -*- Create the XDG_RUNTIME_DIR directory # First, clear existing directories: # Next, make a new runtime directory: # Next, symlink the new directory: Main entry point for xdg-runtime.py script | 2.158765 | 2 |
dashboard/bq_export/bq_export/utils.py | Murka96/catapult | 0 | 6630025 | <reponame>Murka96/catapult
# Copyright (c) 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
imp... | # Copyright (c) 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import apache_beam as beam
##... | en | 0.805071 | # Copyright (c) 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. ## Copy of dashboard.common.utils.TestPath for google.cloud.datastore.key.Key ## rather than ndb.Key. # The Test key looks like ('Master', 'name', 'Bot', ... | 2.001976 | 2 |
gigfinder/shpwriter.py | TobiasRosskopf/gigfinder | 0 | 6630026 | #! python3.8
# -*- coding: utf-8 -*-
# File name: shpwriter.py
# Author: <NAME>
# Email: <EMAIL>
# Created: 27.11.2019
# Modified: 27.11.2019
"""
TODO:
Module's docstring
"""
# Standard imports
# ---
# Third party imports
import shapefile
def lat_lng_to_shp(list_lat_lng):
"""TODO: Doc... | #! python3.8
# -*- coding: utf-8 -*-
# File name: shpwriter.py
# Author: <NAME>
# Email: <EMAIL>
# Created: 27.11.2019
# Modified: 27.11.2019
"""
TODO:
Module's docstring
"""
# Standard imports
# ---
# Third party imports
import shapefile
def lat_lng_to_shp(list_lat_lng):
"""TODO: Doc... | en | 0.422899 | #! python3.8 # -*- coding: utf-8 -*- # File name: shpwriter.py # Author: <NAME> # Email: <EMAIL> # Created: 27.11.2019 # Modified: 27.11.2019 TODO: Module's docstring # Standard imports # --- # Third party imports TODO: Docstring # print("{0:.6f}, {1:.6f}".format(lat, lng)) | 3.328034 | 3 |
infrastructure/logger.py | Axerovor/CS285_Homework_ImitationLearning_hw1 | 0 | 6630027 | <reponame>Axerovor/CS285_Homework_ImitationLearning_hw1<filename>infrastructure/logger.py
import os
import torch
from torch.utils.tensorboard import SummaryWriter
import numpy as np
class Logger:
def __init__(self, log_dir, n_logged_samples=10, summary_writer=None):
self._log_dir = log_dir
print('... | import os
import torch
from torch.utils.tensorboard import SummaryWriter
import numpy as np
class Logger:
def __init__(self, log_dir, n_logged_samples=10, summary_writer=None):
self._log_dir = log_dir
print('########################')
print('logging outputs to ', log_dir)
print('##... | en | 0.504333 | #######################') #######################') Will log all scalars in the same plot. # [C, H, W] # reshape the rollouts # max rollout length # pad rollouts to all be same length # log videos to tensorboard event file figure: matplotlib.pyplot figure handle figure: matplotlib.pyplot figure handle figure: matplotli... | 2.693085 | 3 |
answer_selection/datasets/msmarco/reformat_corpus_from_idxs.py | shashiongithub/Document-Modeling-with-External-Information | 0 | 6630028 | ####################################
# Author: <NAME>
# Date: July 2017
# Project: Document Modeling with External Attention for Sentence Extraction
####################################
'''
msmarco dataset
builds data set with new splits |train', val', test
from pre-calculated indexes
'''
import os,sys
import pdb
i... | ####################################
# Author: <NAME>
# Date: July 2017
# Project: Document Modeling with External Attention for Sentence Extraction
####################################
'''
msmarco dataset
builds data set with new splits |train', val', test
from pre-calculated indexes
'''
import os,sys
import pdb
i... | en | 0.644002 | #################################### # Author: <NAME> # Date: July 2017 # Project: Document Modeling with External Attention for Sentence Extraction #################################### msmarco dataset builds data set with new splits |train', val', test from pre-calculated indexes # outputs files # write to output file... | 2.443655 | 2 |
cogs/filters.py | Termed/AlphaWolf | 1 | 6630029 | import discord
import os
from discord.ext import commands
from discord.utils import get
class onMessage(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_message(self, message):
message_content = message.content
if message_content.isupper(... | import discord
import os
from discord.ext import commands
from discord.utils import get
class onMessage(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_message(self, message):
message_content = message.content
if message_content.isupper(... | none | 1 | 2.763339 | 3 | |
tracing.py | anyface/Cpp-Pytorch-Model-Imagenet | 1 | 6630030 | <filename>tracing.py
import torch
import torchvision
from torchvision import transforms
from PIL import Image
from time import time
import numpy as np
# An instance of your model.
model = torchvision.models.resnet18(pretrained=True)
model.eval()
# An example input you would normally provide to your model's forward() ... | <filename>tracing.py
import torch
import torchvision
from torchvision import transforms
from PIL import Image
from time import time
import numpy as np
# An instance of your model.
model = torchvision.models.resnet18(pretrained=True)
model.eval()
# An example input you would normally provide to your model's forward() ... | en | 0.744288 | # An instance of your model. # An example input you would normally provide to your model's forward() method. # Use torch.jit.trace to generate a torch.jit.ScriptModule via tracing. # evalute time # read image # forward # print top-5 predicted labels | 2.568532 | 3 |
cogs/redditmoderation.py | niztg/DevilBot | 1 | 6630031 | <filename>cogs/redditmoderation.py
import discord
from discord.ext import commands
import praw, prawcore
from .utils import checks
class redditModerationCog(commands.Cog):
"""r/Overwatch_Memes Moderation related Commands"""
def __init__(self, bot):
self.bot = bot
self.db_conn = bot.db_conn
... | <filename>cogs/redditmoderation.py
import discord
from discord.ext import commands
import praw, prawcore
from .utils import checks
class redditModerationCog(commands.Cog):
"""r/Overwatch_Memes Moderation related Commands"""
def __init__(self, bot):
self.bot = bot
self.db_conn = bot.db_conn
... | en | 0.808576 | r/Overwatch_Memes Moderation related Commands #0001\nWith a lot of help from ♿nizcomix#7532' Displays moderation leaderboard Displays mod stats for a user, or for you. | 2.6387 | 3 |
heroespy/util/util.py | DanRyanIrish/HEROES-Telescope | 0 | 6630032 | import numpy as np
import matplotlib.pyplot as plt
import sys
import platform
import datetime
from scipy import constants as con
from scipy.special import kv
import urllib2 as url
from bs4 import BeautifulSoup
import os
import tempfile
import shutil
from sunpy.time import parse_time
from scipy.integrate import quad
fr... | import numpy as np
import matplotlib.pyplot as plt
import sys
import platform
import datetime
from scipy import constants as con
from scipy.special import kv
import urllib2 as url
from bs4 import BeautifulSoup
import os
import tempfile
import shutil
from sunpy.time import parse_time
from scipy.integrate import quad
fr... | en | 0.708918 | #data_dir = os.path.join(os.path.dirname(heroes.__file__), "util", "data") A class for data. # densities # source; wolframalpha The X-ray transmission data comes from NIST (http://www.nist.gov/pml/data/xraycoef/index.cfm) Provide the X-ray transmission (0 to 1) in given a path length in meters at a particular energ... | 2.377863 | 2 |
tfx/components/base/base_driver_test.py | NunoEdgarGFlowHub/tfx | 0 | 6630033 | # Copyright 2019 Google LLC. All Rights Reserved.
#
# 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 a... | # Copyright 2019 Google LLC. All Rights Reserved.
#
# 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 a... | en | 0.838823 | # Copyright 2019 Google LLC. All Rights Reserved. # # 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 a... | 1.881947 | 2 |
trace-creator/trace-creator.py | CSIRT-MU/trace-share | 1 | 6630034 | #!/usr/bin/env python
#
# BSD 3-Clause License
#
# Copyright (c) 2018, CSIRT-MU, Masaryk University
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retai... | #!/usr/bin/env python
#
# BSD 3-Clause License
#
# Copyright (c) 2018, CSIRT-MU, Masaryk University
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retai... | en | 0.692866 | #!/usr/bin/env python # # BSD 3-Clause License # # Copyright (c) 2018, CSIRT-MU, Masaryk University # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain... | 1.220829 | 1 |
src/envoxy/tests/test_asserts.py | muzzley/envoxy | 2 | 6630035 | from ..asserts import *
from .fixtures import test_payload
import pytest
import datetime
from ..exceptions import ValidationException
##### assertz #####
def test_assertz_ok(test_payload):
assert assertz(True, "Error", 0, 500) == None
assert assertz(test_payload["username"] == "", "Error", 0, 500) == None
d... | from ..asserts import *
from .fixtures import test_payload
import pytest
import datetime
from ..exceptions import ValidationException
##### assertz #####
def test_assertz_ok(test_payload):
assert assertz(True, "Error", 0, 500) == None
assert assertz(test_payload["username"] == "", "Error", 0, 500) == None
d... | de | 0.332463 | ##### assertz ##### ##### assertz_mandatory ##### ##### assertz_string ##### ##### assertz_integer ##### ##### assertz_float ##### ##### assertz_timestamp ##### ##### assertz_boolean ##### ##### assertz_complex ##### ##### assertz_dict ##### ##### assertz_json ##### ##### assertz_array ##### ##### assertz_uuid ##### ##... | 2.46758 | 2 |
anidbcli/anidbconnector.py | skyejonke/anidbcli | 32 | 6630036 | import socket
import hashlib
import time
import os
import json
import anidbcli.encryptors as encryptors
API_ADDRESS = "api.anidb.net"
API_PORT = 9000
SOCKET_TIMEOUT = 5
MAX_RECEIVE_SIZE = 65507 # Max size of an UDP packet is about 1400B anyway
RETRY_COUNT = 3
API_ENDPOINT_ENCRYPT = "ENCRYPT user=%s&type=1"
API_ENDPOI... | import socket
import hashlib
import time
import os
import json
import anidbcli.encryptors as encryptors
API_ADDRESS = "api.anidb.net"
API_PORT = 9000
SOCKET_TIMEOUT = 5
MAX_RECEIVE_SIZE = 65507 # Max size of an UDP packet is about 1400B anyway
RETRY_COUNT = 3
API_ENDPOINT_ENCRYPT = "ENCRYPT user=%s&type=1"
API_ENDPOI... | en | 0.794067 | # Max size of an UDP packet is about 1400B anyway For class initialization use class methods create_plain or create_secure. Creates unencrypted UDP API connection using the provided credenitals. Creates AES128 encrypted UDP API connection using the provided credenitals and users api key. Crates instance from an existin... | 2.949848 | 3 |
RecoBTag/PerformanceDB/python/measure/Btag_mistag101220.py | ckamtsikis/cmssw | 852 | 6630037 | import FWCore.ParameterSet.Config as cms
BtagPerformanceESProducer_MISTAGJBPL = cms.ESProducer("BtagPerformanceESProducer",
# this is what it makes available
ComponentName = cms.string('MISTAGJBPL'),
# this is where it gets the payload from
PayloadName = cms.strin... | import FWCore.ParameterSet.Config as cms
BtagPerformanceESProducer_MISTAGJBPL = cms.ESProducer("BtagPerformanceESProducer",
# this is what it makes available
ComponentName = cms.string('MISTAGJBPL'),
# this is where it gets the payload from
PayloadName = cms.strin... | en | 0.977839 | # this is what it makes available # this is where it gets the payload from # this is what it makes available # this is where it gets the payload from # this is what it makes available # this is where it gets the payload from # this is what it makes available # this is where it gets the payload from # this is what it ma... | 1.708547 | 2 |
tests/test_commands.py | kali-physi-hacker/pythonanywhere-cli | 0 | 6630038 | <reponame>kali-physi-hacker/pythonanywhere-cli
import os
from mock import patch
from pythonanywhere_wrapper.client import PythonAnywhereError
from pythonanywhere_cli.commands import Command, StaticFile, Webapps
class CommonTestFunctions(object):
def command_options(self, **kwargs):
options = {
... | import os
from mock import patch
from pythonanywhere_wrapper.client import PythonAnywhereError
from pythonanywhere_cli.commands import Command, StaticFile, Webapps
class CommonTestFunctions(object):
def command_options(self, **kwargs):
options = {
"--api_key": None,
"--help": Fa... | none | 1 | 2.239162 | 2 | |
labelbits_gpio_40_41.py | TheMindVirus/labelbits | 0 | 6630039 | class label:
def __init__(self, name = "[LABEL]",
shift = 0, mask = 0xFFFFFFFF, comment = "", *args, **kwargs):
self.name = name
self.shift = shift
self.mask = mask
self.comment = comment;
class labelbits:
def __init__(self, labels = [], bits = 32, *args, **kwar... | class label:
def __init__(self, name = "[LABEL]",
shift = 0, mask = 0xFFFFFFFF, comment = "", *args, **kwargs):
self.name = name
self.shift = shift
self.mask = mask
self.comment = comment;
class labelbits:
def __init__(self, labels = [], bits = 32, *args, **kwar... | none | 1 | 3.218371 | 3 | |
automation_infra/utils/tunnelled_requestor.py | AnyVisionltd/automation-infra | 6 | 6630040 | <gh_stars>1-10
import requests
from automation_infra.utils.httprequestor import HTTPRequestor
class TunnelledRequestor(HTTPRequestor):
"""The goal of the requestor object is to enable communication with a service in different ways.
This requestor enables interacting with a service via an existing tunnel.
... | import requests
from automation_infra.utils.httprequestor import HTTPRequestor
class TunnelledRequestor(HTTPRequestor):
"""The goal of the requestor object is to enable communication with a service in different ways.
This requestor enables interacting with a service via an existing tunnel.
Other possible... | en | 0.858906 | The goal of the requestor object is to enable communication with a service in different ways. This requestor enables interacting with a service via an existing tunnel. Other possible requestors are Kong requestor (to use for interacting with a service via kong), or others as the need arises. params: tunnel:... | 3.005185 | 3 |
mayan/apps/documents/migrations/0043_auto_20180429_0759.py | Fourdee/mayan-edms | 4 | 6630041 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-29 07:59
from __future__ import unicode_literals
import django.core.files.storage
from django.db import migrations, models
import documents.models
class Migration(migrations.Migration):
dependencies = [
('documents', '0042_a... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-29 07:59
from __future__ import unicode_literals
import django.core.files.storage
from django.db import migrations, models
import documents.models
class Migration(migrations.Migration):
dependencies = [
('documents', '0042_auto_20180403_07... | en | 0.693727 | # -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-04-29 07:59 | 1.70499 | 2 |
src/utils/utils.py | elisaF/rst_discourse_parser | 1 | 6630042 | <reponame>elisaF/rst_discourse_parser
import re
from itertools import izip
from nltk.tree import Tree
from trees.parse_tree import ParseTree
import rst_lib
import string
def replace_words(text, word_dic):
"""
take a text and <strong class="highlight">replace</strong> <strong class="highlight">words</s... | import re
from itertools import izip
from nltk.tree import Tree
from trees.parse_tree import ParseTree
import rst_lib
import string
def replace_words(text, word_dic):
"""
take a text and <strong class="highlight">replace</strong> <strong class="highlight">words</strong> that match a key in a dictionar... | en | 0.331073 | take a text and <strong class="highlight">replace</strong> <strong class="highlight">words</strong> that match a key in a dictionary with
the associated value, return the changed text # Split Returns a simplified POS tag:
NP-SBJ -> NP
PP=4 -> PP
-RRB- -> -RRB- #tree = trees[i] #dep_type = type2class... | 2.88718 | 3 |
src/qt_models/propeditormodel.py | facade-technologies-inc/facile | 2 | 6630043 | """
..
/------------------------------------------------------------------------------\
| -- FACADE TECHNOLOGIES INC. CONFIDENTIAL -- |
|------------------------------------------------------------------------------|
| ... | """
..
/------------------------------------------------------------------------------\
| -- FACADE TECHNOLOGIES INC. CONFIDENTIAL -- |
|------------------------------------------------------------------------------|
| ... | en | 0.715113 | .. /------------------------------------------------------------------------------\ | -- FACADE TECHNOLOGIES INC. CONFIDENTIAL -- | |------------------------------------------------------------------------------| | ... | 1.936207 | 2 |
Unit2/OnlineWorks/Draw2.py | yuhao1998/PythonStudy | 0 | 6630044 | <reponame>yuhao1998/PythonStudy
'''
turtle八角图形绘制
描述
使用turtle库,绘制一个八角图形。
'''
import turtle as t
t.pensize(2)
for i in range(... | '''
turtle八角图形绘制
描述
使用turtle库,绘制一个八角图形。
'''
import turtle as t
t.pensize(2)
for i in range(8):
t.fd(150)
t.left(135... | zh | 0.312434 | turtle八角图形绘制 描述 使用turtle库,绘制一个八角图形。 | 2.917784 | 3 |
core_tools/data/ds/data_set_DataMgr.py | opietx/core_tools | 0 | 6630045 | import numpy as np
import copy
import string
class m_param_origanizer():
def __init__(self, m_param_raw):
self.m_param_raw = m_param_raw
def get(self, key, nth_set):
items = self[key]
for i in items:
if i.nth_set == nth_set:
return i
raise ValueErro... | import numpy as np
import copy
import string
class m_param_origanizer():
def __init__(self, m_param_raw):
self.m_param_raw = m_param_raw
def get(self, key, nth_set):
items = self[key]
for i in items:
if i.nth_set == nth_set:
return i
raise ValueErro... | en | 0.595729 | gets a list with parameters containing this key Returns list<m_param_raw> : raw parameters originating from this id. get the measurement id's #autogenerate parameter info # from python 3.6 (super handy :) ) Args: m_param_raw (m_param_raw) : pointer to the raw parameter to add ... | 2.649228 | 3 |
DataStructure/codes/doublyLinkedList.py | yangdongjue5510/TIL | 0 | 6630046 | <reponame>yangdongjue5510/TIL
class Node:
def __init__(self, key = None):
self.key = key
self.next = self.prev = self
def __str__(self):
return str(self.key)
class DoublyLinkedList:
def __init__(self):
self.head = Node()
self.size = 0
def __iter__(self): #반복하게 만... | class Node:
def __init__(self, key = None):
self.key = key
self.next = self.prev = self
def __str__(self):
return str(self.key)
class DoublyLinkedList:
def __init__(self):
self.head = Node()
self.size = 0
def __iter__(self): #반복하게 만드는 반복자. yield가 있는게 generator
... | ko | 0.999582 | #반복하게 만드는 반복자. yield가 있는게 generator #return과 비슷. #splice #cut #insert after x #search #isEmpty #first last #노드 a를 노드 x 뒤로 이동 #a를 떼어내어 x뒤로 붙인 것과 같다 #노드 a를 노드 x 앞으로 이동 #key값을 갖는 노드를 x뒤에 삽입 #key값을 갖는 노드를 x앞에 삽입 # key값을 갖는 노드를 헤드 뒤에 삽입 # key값을 갖는 노드를 헤드 앞에 삽입 #삭제 | 3.611589 | 4 |
Chapter08/c8_06_noLonger_working.py | John-ye666/Python-for-Finance-Second-Edition | 236 | 6630047 | <reponame>John-ye666/Python-for-Finance-Second-Edition<filename>Chapter08/c8_06_noLonger_working.py
import pandas as pd
url='http://chart.yahoo.com/table.csv?s=IBM'
x=pd.read_csv(url,index_col=0,parse_dates=True)
print(x.head())
| import pandas as pd
url='http://chart.yahoo.com/table.csv?s=IBM'
x=pd.read_csv(url,index_col=0,parse_dates=True)
print(x.head()) | none | 1 | 2.865102 | 3 | |
exeteracovid/scripts/export_diet_data_to_csv.py | deng113jie/ExeTeraCovid | 3 | 6630048 | import numpy as np
import pandas as pd
from exeteracovid.algorithms.healthy_diet_index import healthy_diet_index
def export_diet_data_to_csv(s, src_data, geo_data, dest_data, csv_file):
src_ptnts = src_data['patients']
src_diet = src_data['diet']
geo_ptnts = geo_data['patients']
ffq_questions = ('ff... | import numpy as np
import pandas as pd
from exeteracovid.algorithms.healthy_diet_index import healthy_diet_index
def export_diet_data_to_csv(s, src_data, geo_data, dest_data, csv_file):
src_ptnts = src_data['patients']
src_diet = src_data['diet']
geo_ptnts = geo_data['patients']
ffq_questions = ('ff... | none | 1 | 2.901014 | 3 | |
cowsay/lib/cows/satanic.py | Ovlic/cowsay_py | 0 | 6630049 | <reponame>Ovlic/cowsay_py<filename>cowsay/lib/cows/satanic.py
def Satanic(thoughts, eyes, eye, tongue):
return f"""
{thoughts}
{thoughts} (__)
(\\/)
/-------\\/
/ | 666 ||{tongue}
* ||----||
~~ ~~
""" | def Satanic(thoughts, eyes, eye, tongue):
return f"""
{thoughts}
{thoughts} (__)
(\\/)
/-------\\/
/ | 666 ||{tongue}
* ||----||
~~ ~~
""" | en | 0.387643 | {thoughts} {thoughts} (__) (\\/) /-------\\/ / | 666 ||{tongue} * ||----|| ~~ ~~ | 1.938572 | 2 |
src/webapp/webapp.py | Somsubhra/Enrich | 1 | 6630050 | <reponame>Somsubhra/Enrich
# Headers
__author__ = '<NAME>'
__email__ = '<EMAIL>'
# All imports
from flask import Flask, render_template, request, jsonify
from extras import Logger
from output import Tagger
# The Web App class
class WebApp:
# Constructor for the Web App class
def __init__(self, host, port,... | # Headers
__author__ = '<NAME>'
__email__ = '<EMAIL>'
# All imports
from flask import Flask, render_template, request, jsonify
from extras import Logger
from output import Tagger
# The Web App class
class WebApp:
# Constructor for the Web App class
def __init__(self, host, port, debug):
self.host... | en | 0.531977 | # Headers # All imports # The Web App class # Constructor for the Web App class # Index route # Run the Web App | 2.795882 | 3 |