hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7021680a650fbf392533e7a3c5f721b93c96e14 | 32,599 | py | Python | contrib/script/py/mmp/mmp_mcss_objects.py | michaelweiss092/LillyMol | a2b7d1d8a07ef338c754a0a2e3b2624aac694cc9 | [
"Apache-2.0"
] | 53 | 2018-06-01T13:16:15.000Z | 2022-02-23T21:04:28.000Z | contrib/script/py/mmp/mmp_mcss_objects.py | michaelweiss092/LillyMol | a2b7d1d8a07ef338c754a0a2e3b2624aac694cc9 | [
"Apache-2.0"
] | 19 | 2018-08-14T13:43:18.000Z | 2021-09-24T12:53:11.000Z | contrib/script/py/mmp/mmp_mcss_objects.py | michaelweiss092/LillyMol | a2b7d1d8a07ef338c754a0a2e3b2624aac694cc9 | [
"Apache-2.0"
] | 19 | 2018-10-23T19:41:01.000Z | 2022-02-17T08:14:00.000Z | ###################################################################
""" Summary: Class and Methods for deriving MCSS based MMP's
About: Derive a matched pair based MCSS from a pair molecules
To do: - extend the method enumerate_fragment_properties to also
enumerate self.mol_smi_dict as this would allow th... | 53.006504 | 183 | 0.573668 | + ","
out_string = out_string + str(sum(input_list[0])) + "," + ctx_smi + ","
out_string = out_string + str(self.refsmi_dict[input_list[2]]) + "," \
+ str(self.refsmi_dict[input_list[3]])
out_string += "\n"
return out_string
... | true | true |
f702188d7b7bb22be9247c6cc3e29831e6c5e577 | 1,344 | py | Python | scanner/actions/action.py | Eerovil/magic-cards | b4f18ae9656be58e99fc90146c8ac7473371ce55 | [
"MIT"
] | null | null | null | scanner/actions/action.py | Eerovil/magic-cards | b4f18ae9656be58e99fc90146c8ac7473371ce55 | [
"MIT"
] | null | null | null | scanner/actions/action.py | Eerovil/magic-cards | b4f18ae9656be58e99fc90146c8ac7473371ce55 | [
"MIT"
] | null | null | null | import os
import json
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
class Action:
def __init__(self, card, config):
config.pop("action", None)
self.card = card
self.config = config
def env_vars_for_object(self, config, prefix):
env_vars = {}
config.pop("... | 29.217391 | 76 | 0.590774 | import os
import json
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
class Action:
def __init__(self, card, config):
config.pop("action", None)
self.card = card
self.config = config
def env_vars_for_object(self, config, prefix):
env_vars = {}
config.pop("... | true | true |
f70218f2b4f389dac4b6b4a28a071cb1c97475d0 | 5,869 | py | Python | office365/sharepoint/tenant/administration/tenant.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | office365/sharepoint/tenant/administration/tenant.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | office365/sharepoint/tenant/administration/tenant.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | from office365.runtime.client_value_collection import ClientValueCollection
from office365.runtime.queries.service_operation_query import ServiceOperationQuery
from office365.runtime.resource_path import ResourcePath
from office365.sharepoint.base_entity import BaseEntity
from office365.sharepoint.tenant.administration... | 39.655405 | 116 | 0.679332 | from office365.runtime.client_value_collection import ClientValueCollection
from office365.runtime.queries.service_operation_query import ServiceOperationQuery
from office365.runtime.resource_path import ResourcePath
from office365.sharepoint.base_entity import BaseEntity
from office365.sharepoint.tenant.administration... | true | true |
f702195bb70c4dc9e85f7b299df907641db11dfa | 12,564 | py | Python | python/ccxt/async_support/base/exchange.py | roeiba/ccxt | 01060e12b20925fe29f1485dcb21b8cf44326d2a | [
"MIT"
] | 1 | 2019-10-30T13:32:54.000Z | 2019-10-30T13:32:54.000Z | python/ccxt/async_support/base/exchange.py | roeiba/ccxt | 01060e12b20925fe29f1485dcb21b8cf44326d2a | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | roeiba/ccxt | 01060e12b20925fe29f1485dcb21b8cf44326d2a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
__version__ = '1.18.1333'
# -----------------------------------------------------------------------------
import asyncio
import concurrent
import socket
import time
import math
import random
import certifi
import... | 41.740864 | 355 | 0.610236 |
__version__ = '1.18.1333'
import asyncio
import concurrent
import socket
import time
import math
import random
import certifi
import aiohttp
import ssl
import sys
import yarl
from ccxt.async_support.base.throttle import throttle
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Exchan... | true | true |
f70219fcb6e5ca2640cb076239567264444a0e4f | 553 | py | Python | src/CSVreader.py | Shannon-NJIT/Calculator-Individual | c7dcb961c0f1fa364f9eaa2e85fb371e74646e78 | [
"MIT"
] | null | null | null | src/CSVreader.py | Shannon-NJIT/Calculator-Individual | c7dcb961c0f1fa364f9eaa2e85fb371e74646e78 | [
"MIT"
] | null | null | null | src/CSVreader.py | Shannon-NJIT/Calculator-Individual | c7dcb961c0f1fa364f9eaa2e85fb371e74646e78 | [
"MIT"
] | null | null | null | import csv
def ClassFactory(class_name, dictionary):
return type(class_name, (object,), dictionary)
class CsvReader:
def __init__(self, filepath):
self.data = []
with open(filepath) as csv_files:
csv_data = csv.DictReader(csv_files, delimiter=',')
for row in csv_data... | 23.041667 | 63 | 0.609403 | import csv
def ClassFactory(class_name, dictionary):
return type(class_name, (object,), dictionary)
class CsvReader:
def __init__(self, filepath):
self.data = []
with open(filepath) as csv_files:
csv_data = csv.DictReader(csv_files, delimiter=',')
for row in csv_data... | true | true |
f7021b2241ee6f40086a774d14a70f8306e2ebd9 | 16,965 | py | Python | dashboard/dashboard/pinpoint/models/quest/read_value_test.py | stefb965/catapult | 93f9ef7fc26f0c4904ce691856ec579d2eeef824 | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard/pinpoint/models/quest/read_value_test.py | stefb965/catapult | 93f9ef7fc26f0c4904ce691856ec579d2eeef824 | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard/pinpoint/models/quest/read_value_test.py | stefb965/catapult | 93f9ef7fc26f0c4904ce691856ec579d2eeef824 | [
"BSD-3-Clause"
] | 1 | 2020-07-24T04:42:31.000Z | 2020-07-24T04:42:31.000Z | # Copyright 2017 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.
import json
import unittest
import mock
from dashboard.pinpoint.models.quest import read_value
from tracing.value import histogram_set
from tracing.value i... | 35.124224 | 80 | 0.696611 |
import json
import unittest
import mock
from dashboard.pinpoint.models.quest import read_value
from tracing.value import histogram_set
from tracing.value import histogram as histogram_module
from tracing.value.diagnostics import generic_set
from tracing.value.diagnostics import reserved_infos
_BASE_ARGUMENTS_H... | true | true |
f7021c0fb6668b29ae4164901fe3e6cf9296fc62 | 2,637 | py | Python | tests/components/fan/test_init.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | tests/components/fan/test_init.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | tests/components/fan/test_init.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Tests for fan platforms."""
import pytest
from homeassistant.components.fan import FanEntity
class BaseFan(FanEntity):
"""Implementation of the abstract FanEntity."""
def __init__(self):
"""Initialize the fan."""
def test_fanentity():
"""Test fan entity methods."""
fan = BaseFan()
... | 31.023529 | 63 | 0.678043 |
import pytest
from homeassistant.components.fan import FanEntity
class BaseFan(FanEntity):
def __init__(self):
def test_fanentity():
fan = BaseFan()
assert fan.state == "off"
assert fan.preset_modes is None
assert fan.supported_features == 0
assert fan.percentage_step == 1
assert fan.... | true | true |
f7021c9e32ae1eacec61afce8758e91751fe595e | 89 | py | Python | ynab-api/tests/test_ynab_api.py | mcbobke/python-fun | ecabf87b6d5983c6e2321a15d2f084bf83370b5d | [
"MIT"
] | null | null | null | ynab-api/tests/test_ynab_api.py | mcbobke/python-fun | ecabf87b6d5983c6e2321a15d2f084bf83370b5d | [
"MIT"
] | null | null | null | ynab-api/tests/test_ynab_api.py | mcbobke/python-fun | ecabf87b6d5983c6e2321a15d2f084bf83370b5d | [
"MIT"
] | null | null | null | from ynab_api import __version__
def test_version():
assert __version__ == '0.1.0'
| 14.833333 | 33 | 0.719101 | from ynab_api import __version__
def test_version():
assert __version__ == '0.1.0'
| true | true |
f7021d261117c64403f6ac1fccc17613cd3488bb | 4,198 | py | Python | vkbottle/__init__.py | mironovmeow/vkbottle | 46917c737fb5d3ef0530defe2b48d251e52478cb | [
"MIT"
] | 98 | 2021-08-06T05:31:31.000Z | 2022-03-26T03:00:08.000Z | vkbottle/__init__.py | mironovmeow/vkbottle | 46917c737fb5d3ef0530defe2b48d251e52478cb | [
"MIT"
] | 68 | 2021-08-04T09:56:12.000Z | 2022-03-31T16:23:12.000Z | vkbottle/__init__.py | mironovmeow/vkbottle | 46917c737fb5d3ef0530defe2b48d251e52478cb | [
"MIT"
] | 66 | 2021-08-04T09:21:43.000Z | 2022-03-15T14:34:56.000Z | from vkbottle_types import GroupTypes
from vkbottle_types.events import GroupEventType, UserEventType
from .api import (
ABCAPI,
API,
DEFAULT_REQUEST_VALIDATORS,
DEFAULT_RESPONSE_VALIDATORS,
ABCRequestRescheduler,
ABCRequestValidator,
ABCResponseValidator,
ABCTokenGenerator,
Blockin... | 19.990476 | 67 | 0.662935 | from vkbottle_types import GroupTypes
from vkbottle_types.events import GroupEventType, UserEventType
from .api import (
ABCAPI,
API,
DEFAULT_REQUEST_VALIDATORS,
DEFAULT_RESPONSE_VALIDATORS,
ABCRequestRescheduler,
ABCRequestValidator,
ABCResponseValidator,
ABCTokenGenerator,
Blockin... | true | true |
f7021e2dd359a7348e9d9d8017c699383f32b80a | 39 | py | Python | Beginning.py | Vatsal101/AppleDetection | d828616355fe643980385bc4615f26659de28eaa | [
"MIT"
] | null | null | null | Beginning.py | Vatsal101/AppleDetection | d828616355fe643980385bc4615f26659de28eaa | [
"MIT"
] | null | null | null | Beginning.py | Vatsal101/AppleDetection | d828616355fe643980385bc4615f26659de28eaa | [
"MIT"
] | null | null | null | import cv2 as cv
image = cv.imread() | 13 | 19 | 0.666667 | import cv2 as cv
image = cv.imread() | true | true |
f7022030fa7d56ca72d4ea7834e10aac5a5e2e8f | 7,132 | py | Python | SQLAlchemy-0.9.9/test/dialect/mssql/test_engine.py | Abi1ity/uniclust2.0 | c1034eede2425a683712b449d78fdf4d2d5ab414 | [
"BSD-3-Clause"
] | null | null | null | SQLAlchemy-0.9.9/test/dialect/mssql/test_engine.py | Abi1ity/uniclust2.0 | c1034eede2425a683712b449d78fdf4d2d5ab414 | [
"BSD-3-Clause"
] | null | null | null | SQLAlchemy-0.9.9/test/dialect/mssql/test_engine.py | Abi1ity/uniclust2.0 | c1034eede2425a683712b449d78fdf4d2d5ab414 | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8
from sqlalchemy.testing import eq_, engines
from sqlalchemy import *
from sqlalchemy import exc
from sqlalchemy.dialects.mssql import pyodbc, pymssql
from sqlalchemy.engine import url
from sqlalchemy.testing import fixtures
from sqlalchemy import testing
from sqlalchemy.testing import assert_raise... | 40.522727 | 74 | 0.604459 |
from sqlalchemy.testing import eq_, engines
from sqlalchemy import *
from sqlalchemy import exc
from sqlalchemy.dialects.mssql import pyodbc, pymssql
from sqlalchemy.engine import url
from sqlalchemy.testing import fixtures
from sqlalchemy import testing
from sqlalchemy.testing import assert_raises_message
from sqlalc... | true | true |
f70220a64f73af78d376a845924d9ae3730c7b57 | 589 | py | Python | Datacamp Assignments/NLP Skills Track/1. NLP Fundamentals/14_ner_spacy.py | Ali-Parandeh/Data_Science_Playground | c529e9b3692381572de259e7c93938d6611d83da | [
"MIT"
] | null | null | null | Datacamp Assignments/NLP Skills Track/1. NLP Fundamentals/14_ner_spacy.py | Ali-Parandeh/Data_Science_Playground | c529e9b3692381572de259e7c93938d6611d83da | [
"MIT"
] | null | null | null | Datacamp Assignments/NLP Skills Track/1. NLP Fundamentals/14_ner_spacy.py | Ali-Parandeh/Data_Science_Playground | c529e9b3692381572de259e7c93938d6611d83da | [
"MIT"
] | 1 | 2021-03-10T09:40:05.000Z | 2021-03-10T09:40:05.000Z | # Import spacy
import spacy
# Instantiate the English model: nlp
nlp = spacy.load('en', tagger=False, parser= False, matcher = False)
# Create a new document: doc
doc = nlp(article)
# Print all of the found entities and their labels
for ent in doc.ents:
print(ent.label_, ent.text)
""" <script.py> output:
OR... | 19.633333 | 68 | 0.665535 |
import spacy
nlp = spacy.load('en', tagger=False, parser= False, matcher = False)
doc = nlp(article)
for ent in doc.ents:
print(ent.label_, ent.text)
| true | true |
f7022105af9e830f0a6616acaa6e4add128f432c | 1,166 | py | Python | src/cv/movie_to_image.py | skiteta/processing-util | 819637682695ed7a1cb5a5f35df56a487452252a | [
"MIT"
] | null | null | null | src/cv/movie_to_image.py | skiteta/processing-util | 819637682695ed7a1cb5a5f35df56a487452252a | [
"MIT"
] | 11 | 2021-12-15T12:09:02.000Z | 2022-03-28T12:08:48.000Z | src/cv/movie_to_image.py | skiteta/processing-util | 819637682695ed7a1cb5a5f35df56a487452252a | [
"MIT"
] | null | null | null | import glob
import cv2
import os
def extract_frame(movie_files_dir, out_dir):
movie_files = glob.glob(movie_files_dir)
if not movie_files:
print('movie files are not found.')
return
for movie_file in movie_files:
ext = movie_file.split('.')[-1]
if not ext == 'mp4' or not ... | 25.911111 | 77 | 0.569468 | import glob
import cv2
import os
def extract_frame(movie_files_dir, out_dir):
movie_files = glob.glob(movie_files_dir)
if not movie_files:
print('movie files are not found.')
return
for movie_file in movie_files:
ext = movie_file.split('.')[-1]
if not ext == 'mp4' or not ... | true | true |
f702222d3dba2c9d49caadf65f84a04d301756c8 | 9,521 | py | Python | ping360_sonar/ping360_sonar/sonar_interface.py | CentraleNantesRobotics/ping360_sonar_python | f461594aa0345a417f5bb711b8f4500fb4b4727d | [
"MIT"
] | 4 | 2019-12-13T20:52:54.000Z | 2019-12-20T12:33:03.000Z | ping360_sonar/ping360_sonar/sonar_interface.py | CentraleNantesRobotics/ping360_sonar_python | f461594aa0345a417f5bb711b8f4500fb4b4727d | [
"MIT"
] | 9 | 2019-12-13T20:35:41.000Z | 2020-01-09T19:27:56.000Z | ping360_sonar/ping360_sonar/sonar_interface.py | CentraleNantesRobotics/ping360_sonar_python | f461594aa0345a417f5bb711b8f4500fb4b4727d | [
"MIT"
] | 1 | 2020-01-06T08:34:46.000Z | 2020-01-06T08:34:46.000Z | #!/usr/bin/env python
from ping360_sonar.sensor import Ping360
from numpy import pi, sqrt, tan, cos, sign
from brping import definitions
class SonarInterface:
samplePeriodTickDuration = 25e-9
firmwareMinTransmitDuration = 5
firmwareMaxTransmitDuration = 500
firmwareMaxSamples = 1200
firmwareM... | 37.191406 | 153 | 0.561286 |
from ping360_sonar.sensor import Ping360
from numpy import pi, sqrt, tan, cos, sign
from brping import definitions
class SonarInterface:
samplePeriodTickDuration = 25e-9
firmwareMinTransmitDuration = 5
firmwareMaxTransmitDuration = 500
firmwareMaxSamples = 1200
firmwareMinSamplePeriod = 80
... | true | true |
f70222526f54560a524bad79199280aa1ec5f8cb | 1,594 | py | Python | stko/molecular/conversion/md_analysis.py | stevenbennett96/stko | ee340af4fc549d5a2c3e9cba8360661335efe0fd | [
"MIT"
] | null | null | null | stko/molecular/conversion/md_analysis.py | stevenbennett96/stko | ee340af4fc549d5a2c3e9cba8360661335efe0fd | [
"MIT"
] | null | null | null | stko/molecular/conversion/md_analysis.py | stevenbennett96/stko | ee340af4fc549d5a2c3e9cba8360661335efe0fd | [
"MIT"
] | 2 | 2020-05-08T17:51:25.000Z | 2020-05-11T09:03:24.000Z | """
MD Analysis
===========
#. :class:`.MDAnalysis`
Class for converting a molecule to and back from an MDAnalysis object.
"""
import logging
from ...utilities import WrapperNotInstalledException
try:
import MDAnalysis as mda
except ModuleNotFoundError:
mda = None
logger = logging.getLogger(__name__)
c... | 21.540541 | 70 | 0.593476 |
import logging
from ...utilities import WrapperNotInstalledException
try:
import MDAnalysis as mda
except ModuleNotFoundError:
mda = None
logger = logging.getLogger(__name__)
class MDAnalysis:
def __init__(self):
if mda is None:
raise WrapperNotInstalledException(
... | true | true |
f70223428afca7ece72e103d8ae1e6f89b4c2b23 | 98 | py | Python | Resions.py | alaminskaib/PythonPrograms | 0112715d7700a4ebfd0da64a62f8ac20a43f7c79 | [
"MIT"
] | 2 | 2019-11-11T17:19:10.000Z | 2019-11-11T17:22:46.000Z | Resions.py | alaminskaib/PythonPrograms | 0112715d7700a4ebfd0da64a62f8ac20a43f7c79 | [
"MIT"
] | null | null | null | Resions.py | alaminskaib/PythonPrograms | 0112715d7700a4ebfd0da64a62f8ac20a43f7c79 | [
"MIT"
] | null | null | null | def fact (n):
if n == 1:
return 1
else:
return n*fact(n-1)
print(fact(5)) | 14 | 26 | 0.469388 | def fact (n):
if n == 1:
return 1
else:
return n*fact(n-1)
print(fact(5)) | true | true |
f702242582d845653ca4d57a968a9b4017cef70c | 1,332 | py | Python | torchlars/wrapper.py | aknckaan/scrl | bff485e27d8785628e35d2cb73dce06f10065b1f | [
"Apache-2.0"
] | null | null | null | torchlars/wrapper.py | aknckaan/scrl | bff485e27d8785628e35d2cb73dce06f10065b1f | [
"Apache-2.0"
] | null | null | null | torchlars/wrapper.py | aknckaan/scrl | bff485e27d8785628e35d2cb73dce06f10065b1f | [
"Apache-2.0"
] | null | null | null | import torch
from torch.optim import Optimizer
class OptimWrapper(Optimizer):
# Mixin class that defines convenient functions for writing Optimizer Wrappers
def __init__(self, optim):
self.optim = optim
def __getstate__(self):
return self.optim.__getstate__()
def __sets... | 24.666667 | 83 | 0.643393 | import torch
from torch.optim import Optimizer
class OptimWrapper(Optimizer):
def __init__(self, optim):
self.optim = optim
def __getstate__(self):
return self.optim.__getstate__()
def __setstate__(self, state):
self.optim.__setstate__(state)
@property
... | true | true |
f702245801d9c882c5f3432541c972a936bf876a | 257 | py | Python | tests/conftest.py | tonyseek/python-envcfg | bf95998681cb4215fb97810d476f1a2c5a0ed2e5 | [
"MIT"
] | 29 | 2015-01-14T06:19:47.000Z | 2021-04-15T18:22:26.000Z | tests/conftest.py | tonyseek/python-envcfg | bf95998681cb4215fb97810d476f1a2c5a0ed2e5 | [
"MIT"
] | 2 | 2016-04-25T08:15:19.000Z | 2016-07-07T09:04:44.000Z | tests/conftest.py | tonyseek/python-envcfg | bf95998681cb4215fb97810d476f1a2c5a0ed2e5 | [
"MIT"
] | 3 | 2016-07-07T08:19:31.000Z | 2017-10-26T08:16:23.000Z | import os
from pytest import fixture
@fixture(scope='function')
def environ(request):
origin = dict(os.environ)
@request.addfinalizer
def restore_environ():
os.environ.clear()
os.environ.update(origin)
return os.environ
| 16.0625 | 33 | 0.677043 | import os
from pytest import fixture
@fixture(scope='function')
def environ(request):
origin = dict(os.environ)
@request.addfinalizer
def restore_environ():
os.environ.clear()
os.environ.update(origin)
return os.environ
| true | true |
f70224df77f3865e09d7c348b171782f2f84676e | 2,106 | py | Python | src/tests/ftest/pool/destroy_rebuild.py | kmajzero/daos | 286aee8fde0d77838be7c2405885a9958c085ffb | [
"BSD-2-Clause-Patent"
] | 2 | 2021-07-14T12:21:50.000Z | 2021-07-14T12:21:52.000Z | src/tests/ftest/pool/destroy_rebuild.py | kmajzero/daos | 286aee8fde0d77838be7c2405885a9958c085ffb | [
"BSD-2-Clause-Patent"
] | null | null | null | src/tests/ftest/pool/destroy_rebuild.py | kmajzero/daos | 286aee8fde0d77838be7c2405885a9958c085ffb | [
"BSD-2-Clause-Patent"
] | 1 | 2021-11-03T05:00:42.000Z | 2021-11-03T05:00:42.000Z | #!/usr/bin/python3
'''
(C) Copyright 2018-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
from apricot import TestWithServers
from test_utils_pool import TestPool
class DestroyRebuild(TestWithServers):
"""Test class for pool destroy tests.
Test Class Description:
This tes... | 32.90625 | 83 | 0.647198 |
from apricot import TestWithServers
from test_utils_pool import TestPool
class DestroyRebuild(TestWithServers):
CANCEL_FOR_TICKET = [["DAOS-4891", "rank_to_kill", "[0]"]]
def test_destroy_while_rebuilding(self):
self.pool = TestPool(self.context, self.get_dmg_command())
self.po... | true | true |
f702253efe7970a3d73df3a90fcb9ef03d058f4f | 1,692 | py | Python | examples/protocols/asio/udp_echo_server/asio_udp_server_test.py | umarudy/esp-idf | 5667124b60209fb7c04a400e9f3ae1c497ddcd88 | [
"Apache-2.0"
] | 1 | 2021-05-24T07:39:12.000Z | 2021-05-24T07:39:12.000Z | examples/protocols/asio/udp_echo_server/asio_udp_server_test.py | umarudy/esp-idf | 5667124b60209fb7c04a400e9f3ae1c497ddcd88 | [
"Apache-2.0"
] | null | null | null | examples/protocols/asio/udp_echo_server/asio_udp_server_test.py | umarudy/esp-idf | 5667124b60209fb7c04a400e9f3ae1c497ddcd88 | [
"Apache-2.0"
] | 3 | 2021-08-02T07:11:55.000Z | 2021-11-09T06:02:05.000Z | import os
import re
import socket
import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_asio_udp_server(env, extra_data):
"""
steps: |
1. join AP
2. Start server
3. Test connects to server and sends a test message
4. Test evaluates rec... | 36 | 113 | 0.688534 | import os
import re
import socket
import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_protocol_asio_udp_server(env, extra_data):
test_msg = b'echo message from client to server'
dut1 = env.get_dut('udp_echo_server', 'examples/protocols/asio/udp_echo_server', dut_cla... | true | true |
f70225bfe03aae6c356907a08cda096186636654 | 89,628 | py | Python | plugins/slicer/MONAILabel/MONAILabel.py | hkethi002/MONAILabel | 800dd637bf1825a183033faf3aecf62d4f26f491 | [
"Apache-2.0"
] | null | null | null | plugins/slicer/MONAILabel/MONAILabel.py | hkethi002/MONAILabel | 800dd637bf1825a183033faf3aecf62d4f26f491 | [
"Apache-2.0"
] | null | null | null | plugins/slicer/MONAILabel/MONAILabel.py | hkethi002/MONAILabel | 800dd637bf1825a183033faf3aecf62d4f26f491 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | 44.370297 | 159 | 0.646383 |
import copy
import json
import logging
import os
import shutil
import tempfile
import time
import traceback
from collections import OrderedDict
from urllib.parse import quote_plus
import ctk
import qt
import SampleData
import SimpleITK as sitk
import sitkUtils
import slicer
import vtk
import vtkSegmentation... | true | true |
f702268e91a55f101ad2a75a044d59fb343445d7 | 1,636 | py | Python | project_euler/017.letter_counts.py | davemungo/various | ed7c17f8b75a27fc59b0a5cad6125d64d00cd3ce | [
"MIT"
] | 1 | 2020-01-19T01:21:56.000Z | 2020-01-19T01:21:56.000Z | project_euler/017.letter_counts.py | davemungo/various | ed7c17f8b75a27fc59b0a5cad6125d64d00cd3ce | [
"MIT"
] | null | null | null | project_euler/017.letter_counts.py | davemungo/various | ed7c17f8b75a27fc59b0a5cad6125d64d00cd3ce | [
"MIT"
] | 1 | 2021-07-02T14:40:01.000Z | 2021-07-02T14:40:01.000Z | '''
Problem 017
If the numbers 1 to 5 are written out in words: one, two, three, four, five,
then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
If all the numbers from 1 to 1000 (one thousand) inclusive were written out in
words, how many letters would be used?
NOTE: Do not count spaces or hyphens. ... | 27.266667 | 79 | 0.582518 |
ones_names = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven',
'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen',
'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen',
'nineteen']
tens_names = ['zero', 'ten', 'twenty', 'thirty', 'forty',... | true | true |
f70226d0a47419dc066e849b10f0909332f1ddd8 | 2,078 | py | Python | packages/python/plotly/plotly/validators/scattergeo/marker/gradient/__init__.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 3 | 2020-02-04T21:39:20.000Z | 2020-11-17T19:07:07.000Z | packages/python/plotly/plotly/validators/scattergeo/marker/gradient/__init__.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 12 | 2020-06-06T01:22:26.000Z | 2022-03-12T00:13:42.000Z | packages/python/plotly/plotly/validators/scattergeo/marker/gradient/__init__.py | sgn/plotly.py | 587075c9f5a57a3dd60b03b2d47d925fbbb9b9b6 | [
"MIT"
] | 17 | 2019-11-21T14:11:29.000Z | 2019-11-21T15:26:23.000Z | import _plotly_utils.basevalidators
class TypesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="typesrc", parent_name="scattergeo.marker.gradient", **kwargs
):
super(TypesrcValidator, self).__init__(
plotly_name=plotly_name,
paren... | 31.484848 | 88 | 0.632339 | import _plotly_utils.basevalidators
class TypesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="typesrc", parent_name="scattergeo.marker.gradient", **kwargs
):
super(TypesrcValidator, self).__init__(
plotly_name=plotly_name,
paren... | true | true |
f7022769f7e9d35089cc3e3827278c2a72c45ec8 | 1,655 | py | Python | src/yellowdog_client/model/aws_instance.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | src/yellowdog_client/model/aws_instance.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | src/yellowdog_client/model/aws_instance.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass, field
from datetime import datetime
from typing import Optional
from .cloud_provider import CloudProvider
from .instance import Instance
from .instance_status import InstanceStatus
@dataclass
class AwsInstance(Instance):
"""Extends Instance to add fields specific to the AWS com... | 41.375 | 84 | 0.708157 | from dataclasses import dataclass, field
from datetime import datetime
from typing import Optional
from .cloud_provider import CloudProvider
from .instance import Instance
from .instance_status import InstanceStatus
@dataclass
class AwsInstance(Instance):
type: str = field(default="co.yellowdog.platform.model.Aw... | true | true |
f7022774264758dda80e7f7df5daa6745e8fb6c6 | 8,127 | py | Python | zfit/models/basic.py | schmitse/zfit | d42588f1d43532a34a81f31e602d2471780690e2 | [
"BSD-3-Clause"
] | null | null | null | zfit/models/basic.py | schmitse/zfit | d42588f1d43532a34a81f31e602d2471780690e2 | [
"BSD-3-Clause"
] | null | null | null | zfit/models/basic.py | schmitse/zfit | d42588f1d43532a34a81f31e602d2471780690e2 | [
"BSD-3-Clause"
] | null | null | null | """Basic PDFs are provided here.
Gauss, exponential... that can be used together with Functors to build larger models.
"""
# Copyright (c) 2021 zfit
import contextlib
import numpy as np
import tensorflow as tf
import zfit.z.numpy as znp
from zfit import z
from ..core.basepdf import BasePDF
from ..core.space impor... | 43.92973 | 119 | 0.648702 |
import contextlib
import numpy as np
import tensorflow as tf
import zfit.z.numpy as znp
from zfit import z
from ..core.basepdf import BasePDF
from ..core.space import ANY_LOWER, ANY_UPPER, Space
from ..util import ztyping
from ..util.exception import (AnalyticIntegralNotImplemented,
B... | true | true |
f70228d45f25247be7c181a695834dda94491b4d | 6,195 | py | Python | experiments/PV_noPV_7day_20k.py | DavidFellner/Malfunctions_in_LV_grid_datase | f92ca5e5ebc6e7d54c8e5c3d7d6e5c4e4c67fb5c | [
"MIT"
] | null | null | null | experiments/PV_noPV_7day_20k.py | DavidFellner/Malfunctions_in_LV_grid_datase | f92ca5e5ebc6e7d54c8e5c3d7d6e5c4e4c67fb5c | [
"MIT"
] | null | null | null | experiments/PV_noPV_7day_20k.py | DavidFellner/Malfunctions_in_LV_grid_datase | f92ca5e5ebc6e7d54c8e5c3d7d6e5c4e4c67fb5c | [
"MIT"
] | null | null | null | import os
import math
'''
Metric goal is reached
'''
#Sytem settings
dev_mode = False
grid_data_folder = os.path.join(os.getcwd(), 'raw_data_generation', 'input')
raw_data_folder = os.path.join(os.getcwd(), 'raw_data')
datasets_folder = os.path.join(os.getcwd(), 'datasets')
test_data_folder = os.path.join(os.getcwd()... | 66.612903 | 187 | 0.652623 | import os
import math
dev_mode = False
grid_data_folder = os.path.join(os.getcwd(), 'raw_data_generation', 'input')
raw_data_folder = os.path.join(os.getcwd(), 'raw_data')
datasets_folder = os.path.join(os.getcwd(), 'datasets')
test_data_folder = os.path.join(os.getcwd(), 'test')
models_folder = os.path.join(os.getc... | true | true |
f702297271349632584c3aeb49e40b474c6da936 | 18,867 | py | Python | bin/lesson_check.py | kekoziar/lc-data-intro-archives | 1307cdf22cf46a8e7656b642341781397b93116f | [
"CC-BY-4.0"
] | 7 | 2019-05-15T18:30:43.000Z | 2020-12-14T16:24:20.000Z | bin/lesson_check.py | kekoziar/lc-data-intro-archives | 1307cdf22cf46a8e7656b642341781397b93116f | [
"CC-BY-4.0"
] | 20 | 2019-04-16T21:45:29.000Z | 2022-01-19T23:37:29.000Z | bin/lesson_check.py | kekoziar/lc-data-intro-archives | 1307cdf22cf46a8e7656b642341781397b93116f | [
"CC-BY-4.0"
] | 12 | 2018-04-27T18:50:31.000Z | 2022-01-05T14:53:42.000Z | #!/usr/bin/env python3
"""
Check lesson files and their contents.
"""
import os
import glob
import re
from argparse import ArgumentParser
from util import (Reporter, read_markdown, load_yaml, check_unwanted_files,
require)
__version__ = '0.3'
# Where to look for source Markdown files.
SOURCE_DIR... | 33.39292 | 103 | 0.563842 |
import os
import glob
import re
from argparse import ArgumentParser
from util import (Reporter, read_markdown, load_yaml, check_unwanted_files,
require)
__version__ = '0.3'
SOURCE_DIRS = ['', '_episodes', '_extras']
SOURCE_RMD_DIRS = ['_episodes_rmd']
REQUIRED_FILES = {
'%/CODE_O... | true | true |
f7022974d4d86de398d7c731c85dc7c61ca334bc | 16,594 | py | Python | distil_labse_repo/distil_funcs.py | bobub/distil_labse | ad587d7e4e49101a22fb1459b724b25733715caa | [
"Apache-2.0"
] | null | null | null | distil_labse_repo/distil_funcs.py | bobub/distil_labse | ad587d7e4e49101a22fb1459b724b25733715caa | [
"Apache-2.0"
] | null | null | null | distil_labse_repo/distil_funcs.py | bobub/distil_labse | ad587d7e4e49101a22fb1459b724b25733715caa | [
"Apache-2.0"
] | null | null | null | # Imports
import torch
from labml_nn.transformers.switch import SwitchTransformer, SwitchTransformerLayer, SwitchFeedForward
from labml_nn.transformers import MultiHeadAttention
from labml_nn.transformers.feed_forward import FeedForward
import numpy as np
from transformers import AutoConfig, AutoModel
import torch.nn a... | 44.368984 | 187 | 0.693142 |
import torch
from labml_nn.transformers.switch import SwitchTransformer, SwitchTransformerLayer, SwitchFeedForward
from labml_nn.transformers import MultiHeadAttention
from labml_nn.transformers.feed_forward import FeedForward
import numpy as np
from transformers import AutoConfig, AutoModel
import torch.nn as nn
impo... | true | true |
f7022a7f024c96d6c75b7c897d5507df75a22e08 | 647 | py | Python | utilities/video_2_jpg.py | VEDANTGHODKE/Ikshana-Assistant-For-Specially-Visioned | 64958296702b01e47bd2a26316b30b5e28d9b9ae | [
"BSD-2-Clause"
] | 2 | 2020-10-19T09:34:09.000Z | 2020-10-19T12:09:09.000Z | utilities/video_2_jpg.py | VEDANTGHODKE/Ikshana-Assistant-For-Specially-Visioned | 64958296702b01e47bd2a26316b30b5e28d9b9ae | [
"BSD-2-Clause"
] | null | null | null | utilities/video_2_jpg.py | VEDANTGHODKE/Ikshana-Assistant-For-Specially-Visioned | 64958296702b01e47bd2a26316b30b5e28d9b9ae | [
"BSD-2-Clause"
] | null | null | null | import cv2
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-p2', "--path", help="path to input video")
parser.add_argument('-p1', "--spath", help="path where the images should be stored")
parser.add_argument('-n', "--num", help="number from which image label naming starts", type=int)
args = pars... | 28.130435 | 96 | 0.658423 | import cv2
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-p2', "--path", help="path to input video")
parser.add_argument('-p1', "--spath", help="path where the images should be stored")
parser.add_argument('-n', "--num", help="number from which image label naming starts", type=int)
args = pars... | true | true |
f7022b106191f7e769f494a9e9e6e19c38892823 | 1,472 | py | Python | qnarre/doc/justifier.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre/doc/justifier.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre/doc/justifier.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | # Copyright 2019 Quantapix 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 l... | 35.902439 | 79 | 0.536005 |
class Justifier:
def __init__(self, **kw):
super().__init__(**kw)
self.justs = [0] * 9
self.offsets = [(0, 0, 0, 1, 1, 1, 1, 1, 1),
(0, -1, -2, 0, 0, 0, 1, 1, 1),
(0, -1, -2, 0, -1, -2, 0, 0, 0)]
def init_justs(self, justs)... | true | true |
f7022b72854d8995d4771a29eac9e0ad3b7e4567 | 5,213 | py | Python | examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_logging.py | StanfordVL/bullet3_ik | 52da668d60b32bfe6eea96d3ef3b9d442b2b8926 | [
"Zlib"
] | 1 | 2019-08-24T09:06:26.000Z | 2019-08-24T09:06:26.000Z | examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_logging.py | StanfordVL/bullet3_ik | 52da668d60b32bfe6eea96d3ef3b9d442b2b8926 | [
"Zlib"
] | null | null | null | examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_logging.py | StanfordVL/bullet3_ik | 52da668d60b32bfe6eea96d3ef3b9d442b2b8926 | [
"Zlib"
] | null | null | null | """A proto buffer based logging system for minitaur experiments.
The logging system records the time since reset, base position, orientation,
angular velocity and motor information (joint angle, speed, and torque) into a
proto buffer. See minitaur_logging.proto for more details. The episode_proto is
updated per time s... | 36.454545 | 79 | 0.730865 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import datetime
import os
import time
import tensorflow as tf
import minitaur_logging_pb2
NUM_MOTORS = 8
def _update_base_state(base_state, values):
base_state.x = values[0]
base_state.y = values[1]
... | true | true |
f7022bfcbb871ca0f803248d774267f56badc709 | 3,062 | py | Python | tests/test_area.py | everypolitician/everypolitician-popolo-python | 21670d64f78ac33a088d9adc68006c355f21aa35 | [
"MIT"
] | 13 | 2017-02-27T16:06:47.000Z | 2021-04-14T02:56:17.000Z | tests/test_area.py | everypolitician/everypolitician-popolo-python | 21670d64f78ac33a088d9adc68006c355f21aa35 | [
"MIT"
] | 17 | 2016-10-12T17:14:47.000Z | 2017-02-10T14:24:08.000Z | tests/test_area.py | everypolitician/everypolitician-popolo-python | 21670d64f78ac33a088d9adc68006c355f21aa35 | [
"MIT"
] | 4 | 2016-10-20T16:20:31.000Z | 2022-01-08T00:01:57.000Z | # -*- coding: utf-8 -*-
from unittest import TestCase
import six
from popolo_data.importer import Popolo
EXAMPLE_AREA = {
"id": "area/tartu_linn",
"identifiers": [
{
"identifier": "Q3032626",
"scheme": "wikidata"
}
],
"name": "Tartu linn",
"other_names": ... | 27.097345 | 72 | 0.506532 |
from unittest import TestCase
import six
from popolo_data.importer import Popolo
EXAMPLE_AREA = {
"id": "area/tartu_linn",
"identifiers": [
{
"identifier": "Q3032626",
"scheme": "wikidata"
}
],
"name": "Tartu linn",
"other_names": [
{
... | true | true |
f7022c4c7c673a12cef7e81ed9dc5253eeaa03e2 | 1,614 | py | Python | openiPrototype/appUI/importProductData.py | OPENi-ict/ntua_demo | 104118fbe1f54db35386ca96286317ceb64cb658 | [
"Apache-2.0"
] | null | null | null | openiPrototype/appUI/importProductData.py | OPENi-ict/ntua_demo | 104118fbe1f54db35386ca96286317ceb64cb658 | [
"Apache-2.0"
] | null | null | null | openiPrototype/appUI/importProductData.py | OPENi-ict/ntua_demo | 104118fbe1f54db35386ca96286317ceb64cb658 | [
"Apache-2.0"
] | null | null | null | __author__ = 'alvertisjo'
from django.core.serializers import json
import requests
from requests.packages.urllib3 import Timeout
from requests.packages.urllib3.exceptions import ConnectionError
class OpenProductData(object):
def getData(self):
# rowStep=100
# currentPage=0
# #####document... | 38.428571 | 231 | 0.607187 | __author__ = 'alvertisjo'
from django.core.serializers import json
import requests
from requests.packages.urllib3 import Timeout
from requests.packages.urllib3.exceptions import ConnectionError
class OpenProductData(object):
def getData(self):
| true | true |
f7022e79616991d5da307aa7c60dcdfa477777ad | 116 | py | Python | pages/views.py | LombaAnderson/personalizar-user-django | b923587fd9e9cfc65224dd31f80621eb197a6098 | [
"MIT"
] | null | null | null | pages/views.py | LombaAnderson/personalizar-user-django | b923587fd9e9cfc65224dd31f80621eb197a6098 | [
"MIT"
] | null | null | null | pages/views.py | LombaAnderson/personalizar-user-django | b923587fd9e9cfc65224dd31f80621eb197a6098 | [
"MIT"
] | null | null | null | from django.views.generic import TemplateView
class HomePageView(TemplateView):
template_name = "home.html"
| 14.5 | 45 | 0.775862 | from django.views.generic import TemplateView
class HomePageView(TemplateView):
template_name = "home.html"
| true | true |
f7022f7075bdd6537b307688382d872a3f7fd177 | 53 | py | Python | Interfaces/__init__.py | ahmadryan/TurbAn | b8866d103a2ca2f5fbad73bcd4416f19299f22b2 | [
"BSD-2-Clause-Patent"
] | null | null | null | Interfaces/__init__.py | ahmadryan/TurbAn | b8866d103a2ca2f5fbad73bcd4416f19299f22b2 | [
"BSD-2-Clause-Patent"
] | null | null | null | Interfaces/__init__.py | ahmadryan/TurbAn | b8866d103a2ca2f5fbad73bcd4416f19299f22b2 | [
"BSD-2-Clause-Patent"
] | 10 | 2019-03-22T15:30:12.000Z | 2021-02-10T02:55:50.000Z | from . import Simulations
from . import Spacecraft
| 17.666667 | 26 | 0.773585 | from . import Simulations
from . import Spacecraft
| true | true |
f7022ff2149a27035982e6b84787ca961a0ed00e | 2,752 | py | Python | bin/apps/py/lib/hhslib/tests/test_hhslib.py | yorevs/homesetup | 6e77fd0bffbda3a44d4daf95c974b8d2c744eb5d | [
"MIT"
] | 34 | 2018-08-29T11:07:41.000Z | 2022-03-31T12:18:39.000Z | bin/apps/py/lib/hhslib/tests/test_hhslib.py | yorevs/homesetup | 6e77fd0bffbda3a44d4daf95c974b8d2c744eb5d | [
"MIT"
] | 22 | 2020-01-11T01:04:04.000Z | 2020-03-05T17:27:12.000Z | bin/apps/py/lib/hhslib/tests/test_hhslib.py | yorevs/homesetup | 6e77fd0bffbda3a44d4daf95c974b8d2c744eb5d | [
"MIT"
] | 4 | 2020-02-28T03:35:32.000Z | 2020-06-05T15:09:55.000Z | """
@package: jsonutils
@script: test_JsonUtils.py
@purpose: Test Suite for JsonUtils.
@created: Aug 26, 2017
@author: <B>H</B>ugo <B>S</B>aporetti <B>J</B>unior
@mailto: yorevs@hotmail.com
@site: https://github.com/yorevs/homesetup
@license: Please refer to <https://opensource.org/licenses/MIT>
"... | 33.560976 | 67 | 0.667515 | import os
import unittest
from hhslib.security import *
PASSPHRASE = '12345'
SAMPLE_IN_FILE_NAME = "resources/secret.in"
SAMPLE_OUT_FILE_NAME = "resources/secret.out"
OUT_FILE = "resources/outfile.out"
OUT_FILE_GPG = "resources/outfile.out.gpg"
ORIGINAL_FILE_CONTENTS = "HomeSetup Secrets"
ENCODED_FILE_CONTENTS = "... | true | true |
f702305f7ba2cf5b92dd37e75253366482adb81d | 19,015 | py | Python | GUI_app.py | Howardlinsanity/CIS-433-Group-Project-W18 | f821957e498a8062b4d9c90e0cef369851ae236e | [
"BSD-3-Clause"
] | null | null | null | GUI_app.py | Howardlinsanity/CIS-433-Group-Project-W18 | f821957e498a8062b4d9c90e0cef369851ae236e | [
"BSD-3-Clause"
] | 2 | 2021-03-31T18:28:55.000Z | 2021-12-13T19:45:24.000Z | GUI_app.py | Howardlinsanity/CIS-433-Group-Project-W18 | f821957e498a8062b4d9c90e0cef369851ae236e | [
"BSD-3-Clause"
] | null | null | null |
import threading
import requests
# encryption
import Encrypt
import unicodedata
from ttk import Style, Button, Label, Entry, Progressbar, Checkbutton
from Tkinter import Tk, Frame, RIGHT, BOTH, RAISED
from Tkinter import TOP, X, N, LEFT
from Tkinter import END, Listbox, MULTIPLE
from Tkinter import Toplevel, DISABLE... | 35.278293 | 162 | 0.602892 |
import threading
import requests
import Encrypt
import unicodedata
from ttk import Style, Button, Label, Entry, Progressbar, Checkbutton
from Tkinter import Tk, Frame, RIGHT, BOTH, RAISED
from Tkinter import TOP, X, N, LEFT
from Tkinter import END, Listbox, MULTIPLE
from Tkinter import Toplevel, DISABLED
from Tkin... | true | true |
f7023321a26af3f421bcb7abd350b5d2520d5a0e | 2,760 | py | Python | data_collector/helper.py | cardwizard/vulnerable-python-ecosystem | 582fda1f45bbe912352ed31a302d798365628713 | [
"MIT"
] | null | null | null | data_collector/helper.py | cardwizard/vulnerable-python-ecosystem | 582fda1f45bbe912352ed31a302d798365628713 | [
"MIT"
] | null | null | null | data_collector/helper.py | cardwizard/vulnerable-python-ecosystem | 582fda1f45bbe912352ed31a302d798365628713 | [
"MIT"
] | null | null | null | from pipdeptree import get_installed_distributions, build_dist_index, construct_tree
from bs4 import BeautifulSoup
from json import dump, load
from urllib.request import urlretrieve
from pathlib import Path
from unittest import mock
from pkginfo import SDist
from johnnydep.cli import JohnnyDist
import requests
import ... | 29.677419 | 134 | 0.698188 | from pipdeptree import get_installed_distributions, build_dist_index, construct_tree
from bs4 import BeautifulSoup
from json import dump, load
from urllib.request import urlretrieve
from pathlib import Path
from unittest import mock
from pkginfo import SDist
from johnnydep.cli import JohnnyDist
import requests
import ... | true | true |
f7023348f5b5d56b419a34ca4af3669c787d2364 | 575 | py | Python | simulations/NewRochelle_population/sub_average_testing.py | Dynamical-Systems-Laboratory/ABM-COVID-DSL | bf1fcbbd7ae161f2a026335fa830cd21ccdf48f0 | [
"MIT"
] | 3 | 2020-11-04T03:58:49.000Z | 2021-01-14T22:16:24.000Z | simulations/NewRochelle_population/sub_average_testing.py | atruszkowska/ABM-COVID-DSL | bf1fcbbd7ae161f2a026335fa830cd21ccdf48f0 | [
"MIT"
] | 1 | 2021-01-12T14:59:59.000Z | 2021-01-12T14:59:59.000Z | simulations/NewRochelle_population/sub_average_testing.py | atruszkowska/ABM-COVID-DSL | bf1fcbbd7ae161f2a026335fa830cd21ccdf48f0 | [
"MIT"
] | 2 | 2020-11-03T17:18:41.000Z | 2021-01-15T04:13:03.000Z | #!/usr/local/bin/python3.6
# Substitute average testing value from optimization
import sys
if len(sys.argv) != 2:
sys.stderr.write('Usage: python3.X %s sy_fraction\n' % sys.argv[0])
raise SystemExit(1)
sy_fraction = sys.argv[1]
parameters = []
with open('input_data/infection_parameters.txt','r') as fin:
paramete... | 25 | 68 | 0.732174 |
import sys
if len(sys.argv) != 2:
sys.stderr.write('Usage: python3.X %s sy_fraction\n' % sys.argv[0])
raise SystemExit(1)
sy_fraction = sys.argv[1]
parameters = []
with open('input_data/infection_parameters.txt','r') as fin:
parameters = fin.readlines()
for ind,param in enumerate(parameters):
if 'average fra... | true | true |
f7023395c77fc980e89233ef8430c33af75e94f4 | 1,158 | py | Python | functions_string.py | jhuboo/ROSbot | 792c663d3da348a3c375d2aea0b879278451d7be | [
"MIT"
] | null | null | null | functions_string.py | jhuboo/ROSbot | 792c663d3da348a3c375d2aea0b879278451d7be | [
"MIT"
] | null | null | null | functions_string.py | jhuboo/ROSbot | 792c663d3da348a3c375d2aea0b879278451d7be | [
"MIT"
] | null | null | null | """ Simple functions to manipulate strings """
# Replace the functions below with your implementation as described in the assignment
def is_rhyme(word1, word2, k):
"""
Returns True if the last k letters of the two words are the same (case sensitive).
Automatically returns False if either word contains le... | 36.1875 | 86 | 0.614853 |
def is_rhyme(word1, word2, k):
if (k == 0):
return False
if (len(word1) < k or len(word2) < k):
return False
rev_word1 = word1[::-1]
rev_word2 = word2[::-1]
return rev_word1[:k] == rev_word2[:k]
| true | true |
f70233f09d4a5fd06d0484524a760dd01a14127a | 1,318 | py | Python | orgmybmarks.py | aihy/orgmybmarks | 2e263a5ae3167c41d0d7495d2ae99f3d9f6ee256 | [
"MIT"
] | null | null | null | orgmybmarks.py | aihy/orgmybmarks | 2e263a5ae3167c41d0d7495d2ae99f3d9f6ee256 | [
"MIT"
] | null | null | null | orgmybmarks.py | aihy/orgmybmarks | 2e263a5ae3167c41d0d7495d2ae99f3d9f6ee256 | [
"MIT"
] | null | null | null | import sys
if len(sys.argv) != 2:
print("Usage: python3 orgmybmarks.py bookmarks.html")
quit()
file = open(sys.argv[1])
# file = open("in.html")
fileout = open("out.html", "w")
hreflist = []
# 读到第一个链接
numm = 1
while True:
line = file.readline()
if not line:
break
if line.find("HREF") == -1:... | 26.897959 | 106 | 0.616844 | import sys
if len(sys.argv) != 2:
print("Usage: python3 orgmybmarks.py bookmarks.html")
quit()
file = open(sys.argv[1])
fileout = open("out.html", "w")
hreflist = []
numm = 1
while True:
line = file.readline()
if not line:
break
if line.find("HREF") == -1:
continue
num = line.... | true | true |
f70235169294c1d9d15e2d05dddcff373f8b327f | 84 | py | Python | tests/test_execute.py | kevindiltinero/seass3 | 7b108cdf09d2600cab4dc20b069124492feb801a | [
"BSD-2-Clause"
] | 1 | 2018-06-10T08:28:17.000Z | 2018-06-10T08:28:17.000Z | tests/test_execute.py | kevindiltinero/seass3 | 7b108cdf09d2600cab4dc20b069124492feb801a | [
"BSD-2-Clause"
] | null | null | null | tests/test_execute.py | kevindiltinero/seass3 | 7b108cdf09d2600cab4dc20b069124492feb801a | [
"BSD-2-Clause"
] | null | null | null | import main
def test_execute():
count = main.results
assert count == 400410 | 16.8 | 26 | 0.690476 | import main
def test_execute():
count = main.results
assert count == 400410 | true | true |
f70235171c12de4abc9cc41be600db803f93f97c | 23,197 | py | Python | pyburst/mcmc/mcmc_plot.py | zacjohnston/pyburst | f7d5ae9a229704d1cbcf656afb9fb3e29fb71c0c | [
"MIT"
] | 4 | 2019-05-01T07:30:15.000Z | 2021-08-04T15:04:38.000Z | pyburst/mcmc/mcmc_plot.py | zacjohnston/pyburst | f7d5ae9a229704d1cbcf656afb9fb3e29fb71c0c | [
"MIT"
] | null | null | null | pyburst/mcmc/mcmc_plot.py | zacjohnston/pyburst | f7d5ae9a229704d1cbcf656afb9fb3e29fb71c0c | [
"MIT"
] | 4 | 2019-03-26T12:38:37.000Z | 2022-03-09T05:30:18.000Z | import numpy as np
import os
import sys
import matplotlib.pyplot as plt
import chainconsumer
from math import ceil
# pyburst
from . import mcmc_versions
from . import mcmc_tools
from . import burstfit
from . import mcmc_params
from pyburst.observations import obs_tools
from pyburst.plotting import plot_tools
from pybu... | 40.839789 | 96 | 0.589516 | import numpy as np
import os
import sys
import matplotlib.pyplot as plt
import chainconsumer
from math import ceil
from . import mcmc_versions
from . import mcmc_tools
from . import burstfit
from . import mcmc_params
from pyburst.observations import obs_tools
from pyburst.plotting import plot_tools
from pyburst.grids... | true | true |
f70235e18bbc07ecaef1d55d58b7d01548f0b411 | 1,088 | py | Python | tests/tests_timeout.py | gisce/xmlrpclib-to | c37db9eeff71f379d78ef97e5a206d4efede7821 | [
"MIT"
] | 1 | 2018-04-13T15:42:52.000Z | 2018-04-13T15:42:52.000Z | tests/tests_timeout.py | gisce/xmlrpclib-to | c37db9eeff71f379d78ef97e5a206d4efede7821 | [
"MIT"
] | null | null | null | tests/tests_timeout.py | gisce/xmlrpclib-to | c37db9eeff71f379d78ef97e5a206d4efede7821 | [
"MIT"
] | null | null | null | import socket
import time
from xmlrpclib_to import ServerProxy
import httpretty
import pytest
XML_RESPONSE = """<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value><string>Test</string></value>
</param>
</params>
</methodResponse>"""
def timeout(request, url, headers)... | 19.428571 | 59 | 0.629596 | import socket
import time
from xmlrpclib_to import ServerProxy
import httpretty
import pytest
XML_RESPONSE = """<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value><string>Test</string></value>
</param>
</params>
</methodResponse>"""
def timeout(request, url, headers)... | true | true |
f702369c720d1d7f21a51cf5907306bdf414098a | 306 | py | Python | bookmarks/images/signals.py | anilsaini10/django-bookmarks | 9bb77aa73c35322f68873de0e8e4fb6f596465bf | [
"MIT"
] | 5 | 2020-09-08T08:12:28.000Z | 2020-09-09T20:50:26.000Z | bookmarks/images/signals.py | anilsaini10/django-bookmarks | 9bb77aa73c35322f68873de0e8e4fb6f596465bf | [
"MIT"
] | 1 | 2020-10-01T05:46:23.000Z | 2020-10-01T05:46:23.000Z | bookmarks/images/signals.py | anilsaini10/django-bookmarks | 9bb77aa73c35322f68873de0e8e4fb6f596465bf | [
"MIT"
] | 1 | 2020-09-30T19:41:40.000Z | 2020-09-30T19:41:40.000Z | from django.db.models.signals import m2m_changed
from django.dispatch import receiver
from .models import Image
@receiver(m2m_changed, sender=Image.users_like.through)
def users_like_changed(sender, instance, **kwargs):
instance.total_likes = instance.users_like.count()
instance.save()
| 30.6 | 56 | 0.77451 | from django.db.models.signals import m2m_changed
from django.dispatch import receiver
from .models import Image
@receiver(m2m_changed, sender=Image.users_like.through)
def users_like_changed(sender, instance, **kwargs):
instance.total_likes = instance.users_like.count()
instance.save()
| true | true |
f70236de1aae5c90f06badde4d82b1d629d38b76 | 1,772 | gyp | Python | binding.gyp | ivan/node-blake2 | e0dd018a45bc4a792512b78066ea9378cb542549 | [
"CC0-1.0"
] | 34 | 2015-05-09T23:31:13.000Z | 2019-07-16T17:00:37.000Z | binding.gyp | ludios/node-blake2 | 82c6cb2d4a3bdc43dbc382a56c8c15306b2abfd3 | [
"CC0-1.0"
] | 12 | 2016-07-27T09:16:56.000Z | 2019-09-09T13:19:10.000Z | binding.gyp | ivan/node-blake2 | e0dd018a45bc4a792512b78066ea9378cb542549 | [
"CC0-1.0"
] | 16 | 2015-08-02T05:45:52.000Z | 2019-08-12T14:09:26.000Z | {
"targets": [
{
"target_name": "binding",
"win_delay_load_hook": "true",
"conditions": [
["target_arch == 'x64' or target_arch == 'ia32'", {
"sources": [
"src/binding.cpp",
"src/BLAKE2/sse/blake2b.c",
"src/BLAKE2/sse/blake2bp.c",
"src/BLAKE2/sse/blake2s.c",
"src/BLAKE... | 22.717949 | 83 | 0.520316 | {
"targets": [
{
"target_name": "binding",
"win_delay_load_hook": "true",
"conditions": [
["target_arch == 'x64' or target_arch == 'ia32'", {
"sources": [
"src/binding.cpp",
"src/BLAKE2/sse/blake2b.c",
"src/BLAKE2/sse/blake2bp.c",
"src/BLAKE2/sse/blake2s.c",
"src/BLAKE... | true | true |
f7023897727aa90fe9eab96a3d2bdf6ea1371009 | 10,908 | py | Python | tests/functions/test_process_text.py | vishalbelsare/pyjanitor | 9c5ff2c4ad5969ee4bc683ba82010b55b55fd2bb | [
"MIT"
] | 225 | 2021-04-01T13:57:39.000Z | 2022-03-31T23:12:51.000Z | tests/functions/test_process_text.py | vishalbelsare/pyjanitor | 9c5ff2c4ad5969ee4bc683ba82010b55b55fd2bb | [
"MIT"
] | 251 | 2021-03-25T10:52:31.000Z | 2022-03-31T01:46:29.000Z | tests/functions/test_process_text.py | vishalbelsare/pyjanitor | 9c5ff2c4ad5969ee4bc683ba82010b55b55fd2bb | [
"MIT"
] | 30 | 2021-03-25T20:35:43.000Z | 2022-03-20T20:20:42.000Z | import numpy as np
import pandas as pd
import pytest
from pandas.testing import assert_frame_equal
@pytest.fixture
def process_test_df():
"Base DataFrame"
return pd.DataFrame(
{"text": ["a_b_c", "c_d_e", np.nan, "f_g_h"], "numbers": range(1, 5)}
)
@pytest.fixture
def test_returns_dataframe():
... | 29.010638 | 79 | 0.641272 | import numpy as np
import pandas as pd
import pytest
from pandas.testing import assert_frame_equal
@pytest.fixture
def process_test_df():
return pd.DataFrame(
{"text": ["a_b_c", "c_d_e", np.nan, "f_g_h"], "numbers": range(1, 5)}
)
@pytest.fixture
def test_returns_dataframe():
return pd.DataFrame... | true | true |
f70239220de1326dc46870b4912397756fdb1361 | 18,427 | py | Python | bin/Python27/Lib/site-packages/sympy/printing/tests/test_str.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/sympy/printing/tests/test_str.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/sympy/printing/tests/test_str.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | from __future__ import division
from sympy import (Abs, Catalan, cos, Derivative, E, EulerGamma, exp,
factorial, factorial2, Function, GoldenRatio, I, Integer, Integral,
Interval, Lambda, Limit, log, Matrix, nan, O, oo, pi, Rational, Float, Rel,
S, sin, SparseMatrix, sqrt, summation, Sum, Symbol, symbols, ... | 33.023297 | 139 | 0.515168 | from __future__ import division
from sympy import (Abs, Catalan, cos, Derivative, E, EulerGamma, exp,
factorial, factorial2, Function, GoldenRatio, I, Integer, Integral,
Interval, Lambda, Limit, log, Matrix, nan, O, oo, pi, Rational, Float, Rel,
S, sin, SparseMatrix, sqrt, summation, Sum, Symbol, symbols, ... | true | true |
f702393d2ef35884c8d2fef7496ee40c1e76f58b | 10,876 | py | Python | configs/dsc/fast_dsc_r50_fpn_1x_coco.py | hding2455/DSC | a3f49f549fd569e3c22b6dadbee1013418b9716f | [
"BSD-2-Clause"
] | 13 | 2021-04-26T08:33:00.000Z | 2022-03-30T03:29:36.000Z | configs/dsc/fast_dsc_r50_fpn_1x_coco.py | hding2455/DSC | a3f49f549fd569e3c22b6dadbee1013418b9716f | [
"BSD-2-Clause"
] | 14 | 2021-06-24T07:02:38.000Z | 2022-03-18T21:25:47.000Z | configs/dsc/fast_dsc_r50_fpn_1x_coco.py | hding2455/DSC | a3f49f549fd569e3c22b6dadbee1013418b9716f | [
"BSD-2-Clause"
] | 3 | 2021-10-21T11:42:32.000Z | 2022-03-26T08:30:34.000Z | # model settings
_base_ = [
'../_base_/datasets/coco_instance.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
model = dict(
type='DSC',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(... | 33.88162 | 79 | 0.495954 |
_base_ = [
'../_base_/datasets/coco_instance.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
model = dict(
type='DSC',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
... | true | true |
f70239a34c06e8d819bab5fc729906e65d1d5260 | 420 | py | Python | lists/migrations/0001_initial.py | migglu/todo-lists | 1a9cbdd2b2ff5240ef40946f8e07d18537cd3a12 | [
"MIT"
] | null | null | null | lists/migrations/0001_initial.py | migglu/todo-lists | 1a9cbdd2b2ff5240ef40946f8e07d18537cd3a12 | [
"MIT"
] | null | null | null | lists/migrations/0001_initial.py | migglu/todo-lists | 1a9cbdd2b2ff5240ef40946f8e07d18537cd3a12 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', models.AutoField(primary... | 21 | 114 | 0.585714 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', models.AutoField(primary_key=True, serialize=Fa... | true | true |
f7023a346bd1023538bb62dbeaea32c222fa7d60 | 210 | py | Python | setup.py | chrisjsewell/disk-objectstore | 274c868ade18cb89a38690cb99a28f514aeacba1 | [
"MIT"
] | 6 | 2020-10-22T08:46:08.000Z | 2022-01-27T06:50:07.000Z | setup.py | chrisjsewell/disk-objectstore | 274c868ade18cb89a38690cb99a28f514aeacba1 | [
"MIT"
] | 89 | 2020-04-11T16:25:38.000Z | 2020-07-20T14:52:38.000Z | setup.py | chrisjsewell/disk-objectstore | 274c868ade18cb89a38690cb99a28f514aeacba1 | [
"MIT"
] | 5 | 2020-07-20T17:03:33.000Z | 2022-01-10T13:48:55.000Z | """This file is needed for editable installs (`pip install -e .`).
Can be removed once the following is resolved
https://github.com/pypa/packaging-problems/issues/256
"""
from setuptools import setup
setup()
| 23.333333 | 66 | 0.752381 | from setuptools import setup
setup()
| true | true |
f7023b9f4124b4ce5a8066663f7adc569a5ebde6 | 1,292 | py | Python | examples/mpi/visualization/config.py | FTHPC/FlipIt | 02882de89941d83f89c84856e307ec53c99cf7c0 | [
"NCSA"
] | 7 | 2017-02-20T21:39:33.000Z | 2020-06-05T09:07:15.000Z | examples/mpi/visualization/config.py | FTHPC/FlipIt | 02882de89941d83f89c84856e307ec53c99cf7c0 | [
"NCSA"
] | 3 | 2016-05-05T13:32:10.000Z | 2016-05-29T14:33:07.000Z | examples/mpi/visualization/config.py | FTHPC/FlipIt | 02882de89941d83f89c84856e307ec53c99cf7c0 | [
"NCSA"
] | 4 | 2015-08-27T11:19:53.000Z | 2016-05-03T19:50:35.000Z | ############### Injector Parameters ##################
#
# config - config file used by the compiler pass
# funcList - list of functions that are faulty
# prob - probability that instuction is faulty
# byte - which byte is faulty (0-7) -1 random
# singleInj - one injection per active rank (0 or 1)
# p... | 27.489362 | 57 | 0.537926 | true | true | |
f7023be0695f3585c75bf0627f064210a96296ac | 491 | py | Python | python/stage_5/4673.py | smartx-jshan/Coding_Practice | bc7d485e7992031e55df62483818b721ad7d1d4f | [
"Apache-2.0"
] | null | null | null | python/stage_5/4673.py | smartx-jshan/Coding_Practice | bc7d485e7992031e55df62483818b721ad7d1d4f | [
"Apache-2.0"
] | null | null | null | python/stage_5/4673.py | smartx-jshan/Coding_Practice | bc7d485e7992031e55df62483818b721ad7d1d4f | [
"Apache-2.0"
] | null | null | null | def num(a):
num = int(a)
if (num < 10):
return (num + num)
elif (num <100):
return (num + num //10 + num % 10)
elif (num <1000):
return (num + num //100 + ( (num //10) % 10) + num % 10)
else:
return (num + num //1000 + ((num //100) % 10) + ((num //10) % 10) + num %10)
count = list(range(10000... | 19.64 | 80 | 0.503055 | def num(a):
num = int(a)
if (num < 10):
return (num + num)
elif (num <100):
return (num + num //10 + num % 10)
elif (num <1000):
return (num + num //100 + ( (num //10) % 10) + num % 10)
else:
return (num + num //1000 + ((num //100) % 10) + ((num //10) % 10) + num %10)
count = list(range(10000... | true | true |
f7023be0b6c9bb5058c9f741b1eba904776dc433 | 9,753 | py | Python | python/ccxt/virwox.py | wadaxofficial/ccxt | 765aaa4cd83c1e2dc75717d49b50a55ac4dc0487 | [
"MIT"
] | null | null | null | python/ccxt/virwox.py | wadaxofficial/ccxt | 765aaa4cd83c1e2dc75717d49b50a55ac4dc0487 | [
"MIT"
] | null | null | null | python/ccxt/virwox.py | wadaxofficial/ccxt | 765aaa4cd83c1e2dc75717d49b50a55ac4dc0487 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
class virwox (Exchange):
def describe(self):
... | 36.122222 | 126 | 0.467138 |
ge import Exchange
from ccxt.base.errors import ExchangeError
class virwox (Exchange):
def describe(self):
return self.deep_extend(super(virwox, self).describe(), {
'id': 'virwox',
'name': 'VirWoX',
'countries': ['AT', 'EU'],
'rateLimit': 1000,
... | true | true |
f7023d3f50a4bcdd656f0e33b9e318facfcd714f | 892 | py | Python | kubi_ecs_logger/models/fields/destination.py | kumina/kubi_ecs_logger | 64d9519e0759a24253a4edc53e0c024675033d1c | [
"BSD-3-Clause"
] | 6 | 2019-12-15T12:47:06.000Z | 2022-01-11T08:54:58.000Z | kubi_ecs_logger/models/fields/destination.py | kumina/kubi_ecs_logger | 64d9519e0759a24253a4edc53e0c024675033d1c | [
"BSD-3-Clause"
] | null | null | null | kubi_ecs_logger/models/fields/destination.py | kumina/kubi_ecs_logger | 64d9519e0759a24253a4edc53e0c024675033d1c | [
"BSD-3-Clause"
] | null | null | null | from marshmallow import fields
from .field_set import FieldSet, FieldSetSchema
class Destination(FieldSet):
def __init__(self,
address: str = None,
bytes: int = None,
domain: str = None,
ip: str = None,
mac: str = None,
... | 24.777778 | 47 | 0.533632 | from marshmallow import fields
from .field_set import FieldSet, FieldSetSchema
class Destination(FieldSet):
def __init__(self,
address: str = None,
bytes: int = None,
domain: str = None,
ip: str = None,
mac: str = None,
... | true | true |
f70240c114506f9d8a93be31e8b4a574850c87da | 545 | py | Python | vespawatch/migrations/0053_managementaction_result.py | JWCook/vespa-watch | 7b5fe7dfd3e897d99fd91c479346c89efd890d23 | [
"MIT"
] | 3 | 2019-01-17T09:22:13.000Z | 2020-06-05T03:46:45.000Z | vespawatch/migrations/0053_managementaction_result.py | JWCook/vespa-watch | 7b5fe7dfd3e897d99fd91c479346c89efd890d23 | [
"MIT"
] | 406 | 2018-06-13T18:36:53.000Z | 2022-03-22T16:41:50.000Z | vespawatch/migrations/0053_managementaction_result.py | JWCook/vespa-watch | 7b5fe7dfd3e897d99fd91c479346c89efd890d23 | [
"MIT"
] | 8 | 2019-02-12T10:05:08.000Z | 2020-10-01T05:39:13.000Z | # Generated by Django 2.2.24 on 2021-08-24 10:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vespawatch', '0052_auto_20210824_1131'),
]
operations = [
migrations.AddField(
model_name='managementaction',
name=... | 28.684211 | 197 | 0.614679 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vespawatch', '0052_auto_20210824_1131'),
]
operations = [
migrations.AddField(
model_name='managementaction',
name='result',
field=models.CharField(cho... | true | true |
f70240d38e81353f512252eb5825d0ca09406cdb | 52,563 | py | Python | py_insightvm_sdk/models/resources_vulnerability_validation_resource.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 2 | 2019-03-15T16:05:54.000Z | 2020-07-19T18:37:50.000Z | py_insightvm_sdk/models/resources_vulnerability_validation_resource.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 1 | 2021-03-26T04:46:12.000Z | 2021-03-26T04:51:23.000Z | py_insightvm_sdk/models/resources_vulnerability_validation_resource.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
InsightVM API
# Overview This guide documents the InsightVM Application Programming Interface (API) Version 3. This API supports the Representation State Transfer (REST) design pattern. Unless noted otherwise this API accepts and produces the `application/json` media type. This API uses ... | 352.771812 | 48,045 | 0.497403 |
import pprint
import re
import six
from py_insightvm_sdk.models.link import Link
from py_insightvm_sdk.models.vulnerability_validation_resource import VulnerabilityValidationResource
class ResourcesVulnerabilityValidationResource(object):
swagger_types = {
'links': 'list[Link]',
'reso... | true | true |
f702411b146ade9a780b38d3042522f84e5f82cb | 325 | py | Python | pythonprog/code/12/12.2/logcall.py | davidyshuang/python3 | 5200638f6c4450998d97a9ac24bcba0872786fb2 | [
"Unlicense"
] | null | null | null | pythonprog/code/12/12.2/logcall.py | davidyshuang/python3 | 5200638f6c4450998d97a9ac24bcba0872786fb2 | [
"Unlicense"
] | null | null | null | pythonprog/code/12/12.2/logcall.py | davidyshuang/python3 | 5200638f6c4450998d97a9ac24bcba0872786fb2 | [
"Unlicense"
] | null | null | null | # logcall.py
from functools import wraps
def logged(func):
# Idea: Give me a function, I'll put logging
# around it
print('Adding logging to', func.__name__)
@wraps(func)
def wrapper(*args, **kwargs):
print('You called', func.__name__)
return func(*args, **kwargs)
return wra... | 19.117647 | 48 | 0.633846 |
from functools import wraps
def logged(func):
# around it
print('Adding logging to', func.__name__)
@wraps(func)
def wrapper(*args, **kwargs):
print('You called', func.__name__)
return func(*args, **kwargs)
return wrapper
| true | true |
f7024122a0575e48b00ab24490e91da345677693 | 21,119 | py | Python | sympy/core/tests/test_relational.py | toolforger/sympy | adc391f00e1e35d27925efb0314ec8abde9d255d | [
"BSD-3-Clause"
] | 1 | 2019-06-27T13:40:28.000Z | 2019-06-27T13:40:28.000Z | sympy/core/tests/test_relational.py | toolforger/sympy | adc391f00e1e35d27925efb0314ec8abde9d255d | [
"BSD-3-Clause"
] | null | null | null | sympy/core/tests/test_relational.py | toolforger/sympy | adc391f00e1e35d27925efb0314ec8abde9d255d | [
"BSD-3-Clause"
] | null | null | null | from sympy.utilities.pytest import XFAIL, raises
from sympy import (S, Symbol, symbols, nan, oo, I, pi, Float, And, Or, Not,
Implies, Xor, zoo, sqrt, Rational, simplify, Function)
from sympy.core.compatibility import range
from sympy.core.relational import (Relational, Equality, Unequality,
... | 32.341501 | 78 | 0.564373 | from sympy.utilities.pytest import XFAIL, raises
from sympy import (S, Symbol, symbols, nan, oo, I, pi, Float, And, Or, Not,
Implies, Xor, zoo, sqrt, Rational, simplify, Function)
from sympy.core.compatibility import range
from sympy.core.relational import (Relational, Equality, Unequality,
... | true | true |
f702418be4646ce2cca2d4d5e436f668865ba2a0 | 579 | py | Python | chapter4/main.py | takapat/training-kit-3 | 3140b62a9d618a52d9c957927883255b60e27a0c | [
"Apache-2.0"
] | null | null | null | chapter4/main.py | takapat/training-kit-3 | 3140b62a9d618a52d9c957927883255b60e27a0c | [
"Apache-2.0"
] | 1 | 2018-10-18T05:52:40.000Z | 2018-10-18T10:38:58.000Z | chapter4/main.py | takapat/training-kit-3 | 3140b62a9d618a52d9c957927883255b60e27a0c | [
"Apache-2.0"
] | 7 | 2018-10-19T05:33:26.000Z | 2020-06-02T22:10:40.000Z | from flask import Flask, Response
from camera import Camera
import cv2
app = Flask(__name__)
camera = Camera().start()
def gen(camera):
while True:
frame = camera.read()
_, jpeg = cv2.imencode('.jpg', frame)
yield (b'--frame\r\n'
b'Content-Type: image/jpeg\r\n\r\n' + jpeg.... | 23.16 | 78 | 0.607945 | from flask import Flask, Response
from camera import Camera
import cv2
app = Flask(__name__)
camera = Camera().start()
def gen(camera):
while True:
frame = camera.read()
_, jpeg = cv2.imencode('.jpg', frame)
yield (b'--frame\r\n'
b'Content-Type: image/jpeg\r\n\r\n' + jpeg.... | true | true |
f702419a1d1820b52591b3a643e27f680f9b94ef | 485 | py | Python | PFlib/setup.py | Rogue05/Praca-Magisterska | 863a0522348eddd093b4de05d12c788ef5f2f520 | [
"MIT"
] | null | null | null | PFlib/setup.py | Rogue05/Praca-Magisterska | 863a0522348eddd093b4de05d12c788ef5f2f520 | [
"MIT"
] | null | null | null | PFlib/setup.py | Rogue05/Praca-Magisterska | 863a0522348eddd093b4de05d12c788ef5f2f520 | [
"MIT"
] | null | null | null | from glob import glob
from setuptools import setup
from pybind11.setup_helpers import Pybind11Extension
ext_modules = [
Pybind11Extension(
"PFlib",
# sorted(glob("*.cpp")), # Sort source files for reproducibility
["particle_filter.cpp",],
swig_opts=['-ggdb',],
include_dirs=... | 24.25 | 73 | 0.63299 | from glob import glob
from setuptools import setup
from pybind11.setup_helpers import Pybind11Extension
ext_modules = [
Pybind11Extension(
"PFlib",
swig_opts=['-ggdb',],
include_dirs=['include',]
),
]
setup(
name="PFlib",
ext_modules=ext_modules,
) | true | true |
f702425a5ae41f02c61077b11e3cd43acf7df328 | 3,517 | py | Python | comic_classify/comic_detect.py | docileninja/Calvin-and-Hobbes-Viewer | 74ff2e090e040517e2b445432a5ea6c0f87df49b | [
"MIT"
] | 2 | 2017-01-10T03:22:19.000Z | 2017-02-14T02:57:21.000Z | comic_classify/comic_detect.py | sciencemanx/Calvin-and-Hobbes-Viewer | 74ff2e090e040517e2b445432a5ea6c0f87df49b | [
"MIT"
] | null | null | null | comic_classify/comic_detect.py | sciencemanx/Calvin-and-Hobbes-Viewer | 74ff2e090e040517e2b445432a5ea6c0f87df49b | [
"MIT"
] | 3 | 2018-12-28T04:57:54.000Z | 2020-06-24T04:11:48.000Z | from sklearn import svm, cluster
from PIL import Image, ImageDraw
import os
import sys
import random
def load_images(dirname):
images = []
for image_name in os.listdir(dirname):
if image_name.startswith('.'):
continue
image = Image.open(dirname + '/' + image_name).convert('1')
x, y = image.size
image = ... | 28.827869 | 99 | 0.67387 | from sklearn import svm, cluster
from PIL import Image, ImageDraw
import os
import sys
import random
def load_images(dirname):
images = []
for image_name in os.listdir(dirname):
if image_name.startswith('.'):
continue
image = Image.open(dirname + '/' + image_name).convert('1')
x, y = image.size
image = ... | true | true |
f70242cd924626b37f0454ea32519e3c989f44e0 | 9,876 | py | Python | python/handwritten_baseline/pipeline/data/loader/ecb_reader_utils.py | UKPLab/cdcr-beyond-corpus-tailored | 52bf98692c7464f25628baea24addd1a988f9a1f | [
"Apache-2.0"
] | 10 | 2020-11-28T05:01:04.000Z | 2021-12-21T19:34:00.000Z | python/handwritten_baseline/pipeline/data/loader/ecb_reader_utils.py | UKPLab/cdcr-beyond-corpus-tailored | 52bf98692c7464f25628baea24addd1a988f9a1f | [
"Apache-2.0"
] | 1 | 2022-03-12T07:20:39.000Z | 2022-03-16T05:11:38.000Z | python/handwritten_baseline/pipeline/data/loader/ecb_reader_utils.py | UKPLab/cdcr-beyond-corpus-tailored | 52bf98692c7464f25628baea24addd1a988f9a1f | [
"Apache-2.0"
] | 1 | 2021-12-21T19:34:08.000Z | 2021-12-21T19:34:08.000Z | import logging
import os
import re
import xml.etree.ElementTree as ET
from pathlib import Path
from typing import Any, Tuple, Optional
import pandas as pd
from python import TOPIC_ID, SUBTOPIC, DOCUMENT_NUMBER, DOCUMENT_ID, SENTENCE_IDX, TOKEN_IDX, TOKEN_IDX_TO, \
TOKEN_IDX_FROM, TOKEN, MENTION_ID, EVENT, MENTION... | 50.13198 | 183 | 0.691272 | import logging
import os
import re
import xml.etree.ElementTree as ET
from pathlib import Path
from typing import Any, Tuple, Optional
import pandas as pd
from python import TOPIC_ID, SUBTOPIC, DOCUMENT_NUMBER, DOCUMENT_ID, SENTENCE_IDX, TOKEN_IDX, TOKEN_IDX_TO, \
TOKEN_IDX_FROM, TOKEN, MENTION_ID, EVENT, MENTION... | true | true |
f70245611ab460b5a18c19a0fe4fb4223b15e2ca | 3,343 | py | Python | simplesocial/simplesocial/settings.py | Thesirloc/Stargazer-club-django | 90d2d95f7bb282756582734c591b37b9473b992e | [
"MIT"
] | 1 | 2022-02-06T06:26:23.000Z | 2022-02-06T06:26:23.000Z | simplesocial/simplesocial/settings.py | Thesirloc/Stargazer-club-django | 90d2d95f7bb282756582734c591b37b9473b992e | [
"MIT"
] | null | null | null | simplesocial/simplesocial/settings.py | Thesirloc/Stargazer-club-django | 90d2d95f7bb282756582734c591b37b9473b992e | [
"MIT"
] | 2 | 2018-12-30T12:59:11.000Z | 2019-01-23T12:50:35.000Z | """
Django settings for simplesocial project.
Generated by 'django-admin startproject' using Django 2.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import ... | 25.914729 | 91 | 0.69668 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLAE_DIR = os.path.join(BASE_DIR, 'templates')
SECRET_KEY = '%2^#bfjd61932k^l^fz4ztt+e*9ahjda(7w3xaa0d+^@a&=-6*'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'... | true | true |
f7024605869dd7788905637cfccaa41707efb6c3 | 256 | py | Python | data/scripts/reverse.py | levindu/OpenCC | 345ea91303e5b3d9332dc51ea73370dac83e4c6b | [
"Apache-2.0"
] | 43 | 2018-09-17T00:45:35.000Z | 2021-11-14T23:56:45.000Z | data/scripts/reverse.py | levindu/OpenCC | 345ea91303e5b3d9332dc51ea73370dac83e4c6b | [
"Apache-2.0"
] | 7 | 2019-11-26T10:48:14.000Z | 2021-06-13T04:49:58.000Z | data/scripts/reverse.py | levindu/OpenCC | 345ea91303e5b3d9332dc51ea73370dac83e4c6b | [
"Apache-2.0"
] | 6 | 2018-09-17T02:09:59.000Z | 2020-08-15T13:57:44.000Z | #!/usr/bin/env python
#coding: utf-8
import sys
from common import reverse_items
if len(sys.argv) != 3:
print("Reverse key and value of all pairs")
print(("Usage: ", sys.argv[0], "[input] [output]"))
exit(1)
reverse_items(sys.argv[1], sys.argv[2])
| 21.333333 | 53 | 0.671875 |
import sys
from common import reverse_items
if len(sys.argv) != 3:
print("Reverse key and value of all pairs")
print(("Usage: ", sys.argv[0], "[input] [output]"))
exit(1)
reverse_items(sys.argv[1], sys.argv[2])
| true | true |
f70246589eef38aa124a119a1dbb44c4c2cf9dfc | 6,422 | py | Python | docker/Dockerfile.py | danieldanciu/toil | 5089ccd0ec9dc48e3b3947deabd67fbb8e667d39 | [
"Apache-2.0"
] | null | null | null | docker/Dockerfile.py | danieldanciu/toil | 5089ccd0ec9dc48e3b3947deabd67fbb8e667d39 | [
"Apache-2.0"
] | null | null | null | docker/Dockerfile.py | danieldanciu/toil | 5089ccd0ec9dc48e3b3947deabd67fbb8e667d39 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2015-2016 Regents of the University of California
#
# 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 app... | 39.158537 | 194 | 0.618187 |
from __future__ import print_function
import os
import textwrap
applianceSelf = os.environ['TOIL_APPLIANCE_SELF']
sdistName = os.environ['_TOIL_SDIST_NAME']
dependencies = ' '.join(['libffi-dev',
'python3.6',
'python3.6-dev',
... | true | true |
f7024664218bf4abb7bd1e6581a318ef1357b07c | 2,021 | py | Python | tools/ci/tc/tests/test_decision.py | BasixKOR/wpt | aa27d567c10dcdb2aea6884d5155dfaaa177a800 | [
"BSD-3-Clause"
] | null | null | null | tools/ci/tc/tests/test_decision.py | BasixKOR/wpt | aa27d567c10dcdb2aea6884d5155dfaaa177a800 | [
"BSD-3-Clause"
] | 59 | 2022-01-19T21:35:57.000Z | 2022-03-30T21:35:27.000Z | tools/ci/tc/tests/test_decision.py | BasixKOR/wpt | aa27d567c10dcdb2aea6884d5155dfaaa177a800 | [
"BSD-3-Clause"
] | null | null | null | # mypy: allow-untyped-defs
from unittest import mock
import pytest
from tools.ci.tc import decision
@pytest.mark.parametrize("run_jobs,tasks,expected", [
([], {"task-no-schedule-if": {}}, ["task-no-schedule-if"]),
([], {"task-schedule-if-no-run-job": {"schedule-if": {}}}, []),
(["job"],
{"job-pres... | 35.45614 | 85 | 0.562098 |
from unittest import mock
import pytest
from tools.ci.tc import decision
@pytest.mark.parametrize("run_jobs,tasks,expected", [
([], {"task-no-schedule-if": {}}, ["task-no-schedule-if"]),
([], {"task-schedule-if-no-run-job": {"schedule-if": {}}}, []),
(["job"],
{"job-present": {"schedule-if": {"ru... | true | true |
f70247e814ef6527174be10cc686a320fe4b2b46 | 1,540 | py | Python | ParameterFiles/params_en1_i.py | dunkenj/eazy-pype | 9cb8ac765d659ace36c00293a5809fc4a066e1ec | [
"MIT"
] | 1 | 2019-07-25T10:55:18.000Z | 2019-07-25T10:55:18.000Z | ParameterFiles/params_en1_i.py | dunkenj/eazy-pype | 9cb8ac765d659ace36c00293a5809fc4a066e1ec | [
"MIT"
] | null | null | null | ParameterFiles/params_en1_i.py | dunkenj/eazy-pype | 9cb8ac765d659ace36c00293a5809fc4a066e1ec | [
"MIT"
] | 1 | 2018-12-18T16:31:41.000Z | 2018-12-18T16:31:41.000Z | """
Main inputs:
(Change for all fields)
"""
eazypath = '/data2/ken/photoz/eazy-photoz/src/eazy '
working_folder = '/data2/ken/EN1_pani'
photometry_catalog = 'en1_phot_with_zspec.fits'
photometry_format = 'fits'
filter_file = 'EN1_filters.res'
translate_file = 'EN1.translate'
zspec_col = 'z_spec'
flux_col = 'flux'
... | 18.333333 | 92 | 0.677273 | eazypath = '/data2/ken/photoz/eazy-photoz/src/eazy '
working_folder = '/data2/ken/EN1_pani'
photometry_catalog = 'en1_phot_with_zspec.fits'
photometry_format = 'fits'
filter_file = 'EN1_filters.res'
translate_file = 'EN1.translate'
zspec_col = 'z_spec'
flux_col = 'flux'
fluxerr_col ='fluxerr'
do_zp = False
do_zp_te... | true | true |
f702480ed21c1be212847c37c1516de78ef6c252 | 3,071 | py | Python | bfstpw/views.py | dkess/bfstpw | c1f4ca4126f33e16e756c109c3b0b34f68bbb351 | [
"MIT"
] | null | null | null | bfstpw/views.py | dkess/bfstpw | c1f4ca4126f33e16e756c109c3b0b34f68bbb351 | [
"MIT"
] | null | null | null | bfstpw/views.py | dkess/bfstpw | c1f4ca4126f33e16e756c109c3b0b34f68bbb351 | [
"MIT"
] | null | null | null | from bfstpw.models import ForumThread, ForumPost
from datetime import datetime
from django.conf import settings
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.db.models import Count
from django.http import HttpResponseRedirect
from django.shortcuts import render, ge... | 39.883117 | 102 | 0.674048 | from bfstpw.models import ForumThread, ForumPost
from datetime import datetime
from django.conf import settings
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.db.models import Count
from django.http import HttpResponseRedirect
from django.shortcuts import render, ge... | true | true |
f7024c75af5406622e35a63a1f78be3767533815 | 7,631 | py | Python | Cream/lib/models/builders/build_childnet.py | wkcn/AutoML | 106cb0fbc19fa116c4ef5caf232acaaea85822c8 | [
"MIT"
] | 307 | 2020-10-29T13:17:02.000Z | 2022-03-30T09:55:49.000Z | Cream/lib/models/builders/build_childnet.py | QPC-database/AutoML | 75d86a5e3366a6c9af6c2001ee1ba4fc41c5d6cb | [
"MIT"
] | 42 | 2020-10-30T07:09:48.000Z | 2022-03-29T13:54:56.000Z | Cream/lib/models/builders/build_childnet.py | QPC-database/AutoML | 75d86a5e3366a6c9af6c2001ee1ba4fc41c5d6cb | [
"MIT"
] | 64 | 2020-10-30T10:08:48.000Z | 2022-03-30T06:51:01.000Z | from lib.utils.util import *
from timm.models.efficientnet_blocks import *
# ChildNet Builder definition.
class ChildNetBuilder:
def __init__(
self,
channel_multiplier=1.0,
channel_divisor=8,
channel_min=None,
output_stride=32,
pad_type='',
... | 41.928571 | 103 | 0.538462 | from lib.utils.util import *
from timm.models.efficientnet_blocks import *
class ChildNetBuilder:
def __init__(
self,
channel_multiplier=1.0,
channel_divisor=8,
channel_min=None,
output_stride=32,
pad_type='',
act_layer=None,
... | true | true |
f7024d3b025f432ada7fbb9c7ac3ca1994b5c05e | 8,915 | py | Python | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/payment_sips/models/payment.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/payment_sips/models/payment.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/payment_sips/models/payment.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Copyright 2015 Eezee-It
import json
import logging
from hashlib import sha256
import urlparse
from odoo import models, fields, api
from odoo.tools.float_utils import float_compare
from odoo.tools.translate import _
from odoo.addons.payment.models.payment_acquirer import ValidationError
from odoo.ad... | 39.799107 | 122 | 0.598654 |
import json
import logging
from hashlib import sha256
import urlparse
from odoo import models, fields, api
from odoo.tools.float_utils import float_compare
from odoo.tools.translate import _
from odoo.addons.payment.models.payment_acquirer import ValidationError
from odoo.addons.payment_sips.controllers.main impor... | true | true |
f7024e3194e8a4fab4ea64262a0690eef773048b | 10,727 | py | Python | tensorflow_probability/python/distributions/generalized_pareto_test.py | nbro/probability | 07a6378155f0ed720b5aaccf5387e3f9a432bd10 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/generalized_pareto_test.py | nbro/probability | 07a6378155f0ed720b5aaccf5387e3f9a432bd10 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/generalized_pareto_test.py | nbro/probability | 07a6378155f0ed720b5aaccf5387e3f9a432bd10 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# 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 o... | 39.149635 | 80 | 0.690873 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import hypothesis as hp
import hypothesis.strategies as hps
import numpy as np
from scipy import stats as sp_stats
import tensorflow.compat.v2 as tf
import tensorflow_probability as... | true | true |
f7024e4804728c23068aca067b592692e83ed126 | 551 | py | Python | src/py/fun/vect3dotfun.py | butiran/butiran.github.io | bf99f55819a140190e5bda8f9675109ef607eb9d | [
"MIT"
] | null | null | null | src/py/fun/vect3dotfun.py | butiran/butiran.github.io | bf99f55819a140190e5bda8f9675109ef607eb9d | [
"MIT"
] | 2 | 2020-08-08T13:57:20.000Z | 2020-08-08T14:18:05.000Z | src/py/fun/vect3dotfun.py | butiran/butiran.github.io | bf99f55819a140190e5bda8f9675109ef607eb9d | [
"MIT"
] | 1 | 2020-08-08T13:54:23.000Z | 2020-08-08T13:54:23.000Z | #
# vect3dotfun.py
# Dot product of two 3-d vectors using function in Python 3.7
#
# Sparisoma Viridi | https://github.com/dudung
#
# 20210110
# 2001 Start creating this example.
# 2002 Test it and ok.
#
# Define dot function with two arguments
def dot(a, b):
p = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]
return p
... | 19.678571 | 61 | 0.607985 |
def dot(a, b):
p = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]
return p
r1 = [1, 2, 3]
r2 = [2, 2, 9]
p = dot(r1, r2)
print("r1 = ", r1, sep="");
print("r2 = ", r2, sep="");
print("p = r1 \xb7 r2 = ", p, sep="");
| true | true |
f7024e6e79ada62ffe1b48f5784bcfb79e415eb6 | 555 | py | Python | lambda_handlers/types.py | renovate-tests/lambda-handlers | 0b14013f19b597524a8d50f7ea8813ee726c584c | [
"Apache-2.0"
] | null | null | null | lambda_handlers/types.py | renovate-tests/lambda-handlers | 0b14013f19b597524a8d50f7ea8813ee726c584c | [
"Apache-2.0"
] | null | null | null | lambda_handlers/types.py | renovate-tests/lambda-handlers | 0b14013f19b597524a8d50f7ea8813ee726c584c | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, Union, Optional
from dataclasses import asdict, dataclass
Headers = Optional[Dict[str, Union[str, bool, int]]]
@dataclass
class APIGatewayProxyResult:
"""
Key names are expected and given by AWS APIGateway specifications and must not be changed
"""
statusCode: int
bo... | 27.75 | 93 | 0.695495 | from typing import Any, Dict, Union, Optional
from dataclasses import asdict, dataclass
Headers = Optional[Dict[str, Union[str, bool, int]]]
@dataclass
class APIGatewayProxyResult:
statusCode: int
body: Union[str, Dict[str, Any]]
headers: Headers = None
multiValueHeaders: Headers = None
isBase64E... | true | true |
f7024f1af12ba2367ded56c8c7aef9e10ce2d174 | 206 | py | Python | app/model/response.py | Djaler/VkGraph | 473ad3703c16b7842b3834e062aecaa8057b00cc | [
"MIT"
] | 7 | 2017-03-22T13:41:52.000Z | 2021-01-16T14:13:44.000Z | app/model/response.py | Djaler/VkGraph | 473ad3703c16b7842b3834e062aecaa8057b00cc | [
"MIT"
] | 7 | 2019-10-30T18:44:47.000Z | 2020-08-18T20:19:41.000Z | app/model/response.py | Djaler/VkGraph | 473ad3703c16b7842b3834e062aecaa8057b00cc | [
"MIT"
] | 5 | 2017-06-16T10:34:59.000Z | 2021-12-02T20:37:07.000Z | class Status:
OK = "OK"
ERROR = "ERROR"
class Response(dict):
def __init__(self, status, data):
super().__init__()
self["status"] = status
self["data"] = data
| 17.166667 | 37 | 0.524272 | class Status:
OK = "OK"
ERROR = "ERROR"
class Response(dict):
def __init__(self, status, data):
super().__init__()
self["status"] = status
self["data"] = data
| true | true |
f7024fc117459b9452cffefdc8a339808e80919d | 903 | py | Python | py/worldfiles.py | Andreto/ga-utsikt | 0efb5b8fe3589ed7ccd39a8a665c2674ecd3ea7e | [
"MIT"
] | null | null | null | py/worldfiles.py | Andreto/ga-utsikt | 0efb5b8fe3589ed7ccd39a8a665c2674ecd3ea7e | [
"MIT"
] | null | null | null | py/worldfiles.py | Andreto/ga-utsikt | 0efb5b8fe3589ed7ccd39a8a665c2674ecd3ea7e | [
"MIT"
] | null | null | null | # Copyright (c) 2022 Andreas Törnkvist | MIT License
import math
class worldfile:
def __init__(self, filename):
wFile = open(filename)
w = wFile.readlines()
w = [line.rstrip() for line in w]
self.A = float(w[0])
self.D = float(w[1])
self.B = float(w[2])
sel... | 25.083333 | 56 | 0.487265 |
import math
class worldfile:
def __init__(self, filename):
wFile = open(filename)
w = wFile.readlines()
w = [line.rstrip() for line in w]
self.A = float(w[0])
self.D = float(w[1])
self.B = float(w[2])
self.E = float(w[3])
self.C = float(w[4])
... | true | true |
f7024fe456a0913f82cedffaff816db8b405cfa5 | 22,648 | py | Python | python/tvm/relay/_parser.py | ptrendx/tvm | f07fe80aaf110086b651f2850506c803a5688ddb | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/_parser.py | ptrendx/tvm | f07fe80aaf110086b651f2850506c803a5688ddb | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/_parser.py | ptrendx/tvm | f07fe80aaf110086b651f2850506c803a5688ddb | [
"Apache-2.0"
] | 1 | 2019-12-03T13:53:44.000Z | 2019-12-03T13:53:44.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.40413 | 100 | 0.616478 |
from __future__ import absolute_import
import sys
from ast import literal_eval
from collections import deque
import tvm
from . import module
from .base import Span, SourceName
from . import expr
from . import ty
from . import op
PYTHON_VERSION = sys.version_info.major
try:
from .grammar.py3.R... | true | true |
f702504392500d06ef6b36b82fbef26e508af87f | 2,310 | py | Python | twistit/_errorhandling.py | pydron/twistit | 23ac43b830083fd32c400fcdfa5300e302769c74 | [
"MIT"
] | 1 | 2016-04-08T00:35:54.000Z | 2016-04-08T00:35:54.000Z | twistit/_errorhandling.py | pydron/twistit | 23ac43b830083fd32c400fcdfa5300e302769c74 | [
"MIT"
] | null | null | null | twistit/_errorhandling.py | pydron/twistit | 23ac43b830083fd32c400fcdfa5300e302769c74 | [
"MIT"
] | null | null | null | # Copyright (C) 2015 Stefan C. Mueller
import functools
from twisted.internet import defer
def on_error_close(logger):
"""
Decorator for callback methods that implement `IProtocol`.
Any uncaught exception is logged and the connection is closed
forcefully.
Usage::
import logger
... | 35.538462 | 82 | 0.636364 |
import functools
from twisted.internet import defer
def on_error_close(logger):
def make_wrapper(func):
@functools.wraps(func)
def wrapper(self, *args, **kwargs):
d = defer.maybeDeferred(func, self, *args, **kwargs)
def on_error(err):
... | true | true |
f7025167168843760aa99b53b10d6a7a0fc912e1 | 2,035 | py | Python | .eggs/boto-2.48.0-py2.7.egg/boto/sdb/db/key.py | MQQ/git-bigstore | 95f1e37fcda7fdce80502593cec31a44c604cf8a | [
"Apache-2.0"
] | null | null | null | .eggs/boto-2.48.0-py2.7.egg/boto/sdb/db/key.py | MQQ/git-bigstore | 95f1e37fcda7fdce80502593cec31a44c604cf8a | [
"Apache-2.0"
] | null | null | null | .eggs/boto-2.48.0-py2.7.egg/boto/sdb/db/key.py | MQQ/git-bigstore | 95f1e37fcda7fdce80502593cec31a44c604cf8a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy,... | 33.916667 | 77 | 0.696314 |
class Key(object):
@classmethod
def from_path(cls, *args, **kwds):
raise NotImplementedError("Paths are not currently supported")
def __init__(self, encoded=None, obj=None):
self.name = None
if obj:
self.id = obj.id
self.kind = obj.kind(... | true | true |
f7025258811b22755058146106a8a59727a8d6a1 | 14,181 | py | Python | lib/geomet/wkt.py | davasqueza/eriskco_conector_CloudSQL | 99304b5eed06e9bba3646535a82d7fc98b0838b7 | [
"Apache-2.0"
] | null | null | null | lib/geomet/wkt.py | davasqueza/eriskco_conector_CloudSQL | 99304b5eed06e9bba3646535a82d7fc98b0838b7 | [
"Apache-2.0"
] | null | null | null | lib/geomet/wkt.py | davasqueza/eriskco_conector_CloudSQL | 99304b5eed06e9bba3646535a82d7fc98b0838b7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Lars Butler & individual contributors
#
# 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 applicab... | 28.192843 | 79 | 0.586348 |
import tokenize
try:
import StringIO
except ImportError:
import io
StringIO = io
INVALID_WKT_FMT = 'Invalid WKT: `%s`'
def dump(obj, dest_file):
dest_file.write(dumps(obj))
def load(source_file):
return loads(source_file.read())
def dumps(obj, decimals=16):
geom_type = obj[... | true | true |
f7025441717dc4c50f233a3d069a8ca08670a3c6 | 16,281 | py | Python | gw_app/nas_managers/mod_mikrotik.py | Fa67/djing | 6e84640d7294be9f2f17f73e796713e93e43bb68 | [
"Unlicense"
] | 1 | 2020-12-05T01:55:56.000Z | 2020-12-05T01:55:56.000Z | gw_app/nas_managers/mod_mikrotik.py | Fa67/djing | 6e84640d7294be9f2f17f73e796713e93e43bb68 | [
"Unlicense"
] | null | null | null | gw_app/nas_managers/mod_mikrotik.py | Fa67/djing | 6e84640d7294be9f2f17f73e796713e93e43bb68 | [
"Unlicense"
] | 2 | 2020-03-07T12:00:17.000Z | 2020-12-05T01:56:01.000Z | import binascii
import re
import socket
from abc import ABCMeta
from hashlib import md5
from ipaddress import ip_network, _BaseNetwork
from typing import Iterable, Optional, Tuple, Generator, Dict, Iterator
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from djing.lib.decorato... | 33.989562 | 78 | 0.504146 | import binascii
import re
import socket
from abc import ABCMeta
from hashlib import md5
from ipaddress import ip_network, _BaseNetwork
from typing import Iterable, Optional, Tuple, Generator, Dict, Iterator
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from djing.lib.decorato... | true | true |
f702572d7b68352d734ef7b7cf7598a239ad2912 | 4,653 | py | Python | fabfile/deploy/__init__.py | cjlee112/socraticqs2 | 2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820 | [
"Apache-2.0"
] | 8 | 2015-06-02T15:34:44.000Z | 2019-03-21T12:27:30.000Z | fabfile/deploy/__init__.py | cjlee112/socraticqs2 | 2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820 | [
"Apache-2.0"
] | 761 | 2015-01-07T05:13:08.000Z | 2022-02-10T10:23:37.000Z | fabfile/deploy/__init__.py | cjlee112/socraticqs2 | 2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820 | [
"Apache-2.0"
] | 12 | 2015-01-28T20:09:36.000Z | 2018-03-20T13:32:11.000Z | # coding: utf-8
"""
Fabric task for deploying project on servers(production, staging, development)
"""
import os
import sys
from contextlib import contextmanager
from fabric.contrib import django
from fabric.api import local, run, lcd, cd
from fabric.tasks import Task
from fab_settings import env
sys.path.append(... | 28.722222 | 103 | 0.617451 |
import os
import sys
from contextlib import contextmanager
from fabric.contrib import django
from fabric.api import local, run, lcd, cd
from fabric.tasks import Task
from fab_settings import env
sys.path.append(os.path.dirname(__file__) + '/../../mysite/')
django.settings_module('mysite.settings')
STAGING_BRANCH... | true | true |
f702586dfe5335199a783f1e4b598a01710c8e47 | 1,134 | py | Python | isi_sdk_8_1_0/test/test_license_license_tier_entitlements_exceeded_alert.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_0/test/test_license_license_tier_entitlements_exceeded_alert.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_0/test/test_license_license_tier_entitlements_exceeded_alert.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 5
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_0
from i... | 27.658537 | 147 | 0.765432 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_0
from isi_sdk_8_1_0.models.license_license_tier_entitlements_exceeded_alert import LicenseLicenseTierEntitlementsExceededAlert
from isi_sdk_8_1_0.rest import ApiException
class TestLicenseLicenseTierEntitlementsExceededAlert(unittest.T... | true | true |
f70258bb2c2a7d4122360a14a2ed82fa7d31690f | 1,316 | py | Python | tests/unit-tests/test_confluence_metadata.py | tonybaloney/sphinx-confluencebuilder | fd71fb5d5038b80fa3623dd673c198959dfbab03 | [
"BSD-2-Clause"
] | 1 | 2019-03-09T22:02:52.000Z | 2019-03-09T22:02:52.000Z | tests/unit-tests/test_confluence_metadata.py | tonybaloney/sphinx-confluencebuilder | fd71fb5d5038b80fa3623dd673c198959dfbab03 | [
"BSD-2-Clause"
] | 17 | 2019-03-09T21:34:20.000Z | 2019-03-15T08:42:43.000Z | tests/unit-tests/test_confluence_metadata.py | tonybaloney/sphinx-confluencebuilder | fd71fb5d5038b80fa3623dd673c198959dfbab03 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
:copyright: Copyright 2020-2022 Sphinx Confluence Builder Contributors (AUTHORS)
:license: BSD-2-Clause (LICENSE)
"""
from tests.lib.testcase import ConfluenceTestCase
from tests.lib.testcase import setup_builder
import os
class TestConfluenceMetadata(ConfluenceTestCase):
@classmethod... | 32.097561 | 80 | 0.668693 |
from tests.lib.testcase import ConfluenceTestCase
from tests.lib.testcase import setup_builder
import os
class TestConfluenceMetadata(ConfluenceTestCase):
@classmethod
def setUpClass(cls):
super(TestConfluenceMetadata, cls).setUpClass()
cls.dataset = os.path.join(cls.datasets, 'metadata')
... | true | true |
f70258c7ffe9e101969941678261484178a2e372 | 2,270 | py | Python | testes/prototipo/gamePythonWS/server/server.py | wykke/duck-bomb | e1f8dd3352fd49b48b0d7f99fe72c7c2c65fb59a | [
"MIT"
] | 2 | 2020-03-09T17:45:09.000Z | 2020-03-09T19:16:51.000Z | testes/prototipo/gamePythonWS/server/server.py | wykke/duck-bomb | e1f8dd3352fd49b48b0d7f99fe72c7c2c65fb59a | [
"MIT"
] | 7 | 2020-04-07T13:46:23.000Z | 2020-07-06T23:41:43.000Z | testes/prototipo/gamePythonWS/server/server.py | wykke/duck-bomb | e1f8dd3352fd49b48b0d7f99fe72c7c2c65fb59a | [
"MIT"
] | null | null | null | import asyncio
import websockets
import time
import threading
players = 0
class Player:
def __init__(self, id, x = 0, y = 0, speed = 5):
self.id = id
self.x = x
self.y = y
self.dirX = 0
self.dirY = 0
self.speed = speed
print("Player criado com sucesso!")... | 26.091954 | 106 | 0.54978 | import asyncio
import websockets
import time
import threading
players = 0
class Player:
def __init__(self, id, x = 0, y = 0, speed = 5):
self.id = id
self.x = x
self.y = y
self.dirX = 0
self.dirY = 0
self.speed = speed
print("Player criado com sucesso!")... | true | true |
f70258fcc3cd5eb7d5734b4a7f21593d187343a6 | 55 | py | Python | eats/tests/behave/features/app/__init__.py | Etiqa/eats | 8c8e2da93d0014f6fbb208185712c5526dba1174 | [
"BSD-2-Clause"
] | null | null | null | eats/tests/behave/features/app/__init__.py | Etiqa/eats | 8c8e2da93d0014f6fbb208185712c5526dba1174 | [
"BSD-2-Clause"
] | 5 | 2021-03-18T21:34:44.000Z | 2022-03-11T23:35:23.000Z | eats/tests/behave/features/app/__init__.py | Etiqa/eats | 8c8e2da93d0014f6fbb208185712c5526dba1174 | [
"BSD-2-Clause"
] | null | null | null | __author__ = 'pulphix'
from app import TestApplication | 18.333333 | 31 | 0.818182 | __author__ = 'pulphix'
from app import TestApplication | true | true |
f70259449ecc1b15c11b417e7c81cc8cc9ba3771 | 422 | py | Python | easy_thumbnails_admin/admin.py | Apkawa/easy-thumbnails-admin | 9d7a38f215cdac53a663b00f1d4ff3a3c2a54eb4 | [
"MIT"
] | null | null | null | easy_thumbnails_admin/admin.py | Apkawa/easy-thumbnails-admin | 9d7a38f215cdac53a663b00f1d4ff3a3c2a54eb4 | [
"MIT"
] | null | null | null | easy_thumbnails_admin/admin.py | Apkawa/easy-thumbnails-admin | 9d7a38f215cdac53a663b00f1d4ff3a3c2a54eb4 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
from django.contrib import admin
from .models import ThumbnailOption
from django.contrib.admin.widgets import AdminFileWidget
@admin.register(ThumbnailOption)
class ThumbnailOptionAdmin(admin.ModelAdmin):
fields = ['source', 'alias', 'options']
class Thu... | 20.095238 | 56 | 0.751185 |
from __future__ import unicode_literals
from django.contrib import admin
from .models import ThumbnailOption
from django.contrib.admin.widgets import AdminFileWidget
@admin.register(ThumbnailOption)
class ThumbnailOptionAdmin(admin.ModelAdmin):
fields = ['source', 'alias', 'options']
class ThumbnailOptionMix... | true | true |
f7025a2139b9ed3d7c6a408c7c308ae18dcece8f | 1,177 | py | Python | tests/signaltest.py | zibous/ha-miscale2 | 39486415208ea1c54620c0ed91d68b4167a93c4e | [
"MIT"
] | 25 | 2020-12-14T05:21:08.000Z | 2022-03-28T21:08:06.000Z | tests/signaltest.py | zibous/ha-miscale2 | 39486415208ea1c54620c0ed91d68b4167a93c4e | [
"MIT"
] | null | null | null | tests/signaltest.py | zibous/ha-miscale2 | 39486415208ea1c54620c0ed91d68b4167a93c4e | [
"MIT"
] | 2 | 2021-04-18T12:29:23.000Z | 2021-07-27T15:09:09.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
sys.path.append("..")
try:
import os
import signal
import time
from conf import *
from lib import logger
from lib import mqtt
except Exception as e:
print(f"Import error: {str(e)} line {sys.exc_info()[-1].tb_lineno}, check requi... | 23.078431 | 104 | 0.646559 |
import sys
sys.path.append("..")
try:
import os
import signal
import time
from conf import *
from lib import logger
from lib import mqtt
except Exception as e:
print(f"Import error: {str(e)} line {sys.exc_info()[-1].tb_lineno}, check requirements.txt")
sys.exit(1)
log = logger.... | true | true |
f7025a95efb3508f4614d10c34abe2268a9570db | 1,043 | py | Python | database/sec.py | chung-ejy/longshot | c9ff1a6586546b496ed6ba2f0b43ff9cd68fa15d | [
"MIT"
] | null | null | null | database/sec.py | chung-ejy/longshot | c9ff1a6586546b496ed6ba2f0b43ff9cd68fa15d | [
"MIT"
] | null | null | null | database/sec.py | chung-ejy/longshot | c9ff1a6586546b496ed6ba2f0b43ff9cd68fa15d | [
"MIT"
] | 1 | 2021-08-05T02:12:51.000Z | 2021-08-05T02:12:51.000Z | from database.adatabase import ADatabase
import pandas as pd
class SEC(ADatabase):
def __init__(self):
super().__init__("sec")
def retrieve_num_data(self,adsh):
try:
db = self.client[self.name]
table = db["nums"]
data = table.find({"adsh":adsh},{"_id":0}... | 31.606061 | 75 | 0.5465 | from database.adatabase import ADatabase
import pandas as pd
class SEC(ADatabase):
def __init__(self):
super().__init__("sec")
def retrieve_num_data(self,adsh):
try:
db = self.client[self.name]
table = db["nums"]
data = table.find({"adsh":adsh},{"_id":0}... | true | true |
f7025aa46119097ebc8650ad1c02f9485349b539 | 605 | py | Python | supermario/supermario 1105(2)/start_state.py | Kimmiryeong/2DGP_GameProject | ad3fb197aab27227fc92fd404b2c310f8d0827ca | [
"MIT"
] | null | null | null | supermario/supermario 1105(2)/start_state.py | Kimmiryeong/2DGP_GameProject | ad3fb197aab27227fc92fd404b2c310f8d0827ca | [
"MIT"
] | null | null | null | supermario/supermario 1105(2)/start_state.py | Kimmiryeong/2DGP_GameProject | ad3fb197aab27227fc92fd404b2c310f8d0827ca | [
"MIT"
] | null | null | null | import game_framework
from pico2d import *
import title_state
name = "StartState"
image = None
logo_time = 0.0
def enter():
global image
image = load_image('kpu_credit.png')
def exit():
global image
del(image)
def update():
global logo_time
if (logo_time > 1.0):
logo_time = 0.8
... | 11.634615 | 48 | 0.634711 | import game_framework
from pico2d import *
import title_state
name = "StartState"
image = None
logo_time = 0.0
def enter():
global image
image = load_image('kpu_credit.png')
def exit():
global image
del(image)
def update():
global logo_time
if (logo_time > 1.0):
logo_time = 0.8
... | true | true |
f7025b188f8b1f8584c33840874bfd12437bb343 | 489 | py | Python | Apuntes/Preprocess/Missing Data.py | Aaronga19/MachineLearning-A-Z | e8e27f0a31ac3e3c05d4029e6e5e14ac8a911153 | [
"MIT"
] | null | null | null | Apuntes/Preprocess/Missing Data.py | Aaronga19/MachineLearning-A-Z | e8e27f0a31ac3e3c05d4029e6e5e14ac8a911153 | [
"MIT"
] | null | null | null | Apuntes/Preprocess/Missing Data.py | Aaronga19/MachineLearning-A-Z | e8e27f0a31ac3e3c05d4029e6e5e14ac8a911153 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 13 20:30:46 2020
@author: Aaronga
"""
# Datos faltantes
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv("Data.csv")
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 3].values
# Tratamiento de los NaN
from sklearn.preproc... | 22.227273 | 66 | 0.687117 |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv("Data.csv")
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 3].values
from sklearn.preprocessing import Imputer
imputer = Imputer(missing_values="NaN", strategy="mean", axis = 0)
imputer = imputer.fit(X[:, 1:3])
X[:, ... | true | true |
f7025b360586c29b40347acb0683ce9ba02e33c8 | 5,930 | py | Python | test/sql/test_case_statement.py | Thhhza/sqlalchemy | f2b267043e17b2b769dc2a5b8139f6be2a3d4e84 | [
"MIT"
] | 1 | 2018-04-02T18:41:52.000Z | 2018-04-02T18:41:52.000Z | test/sql/test_case_statement.py | Thhhza/sqlalchemy | f2b267043e17b2b769dc2a5b8139f6be2a3d4e84 | [
"MIT"
] | null | null | null | test/sql/test_case_statement.py | Thhhza/sqlalchemy | f2b267043e17b2b769dc2a5b8139f6be2a3d4e84 | [
"MIT"
] | 3 | 2017-09-26T13:59:24.000Z | 2020-12-04T17:51:54.000Z | from sqlalchemy.testing import assert_raises, eq_
from sqlalchemy.testing import fixtures, AssertsCompiledSQL
from sqlalchemy import (
testing, exc, case, select, literal_column, text, and_, Integer, cast,
String, Column, Table, MetaData)
from sqlalchemy.sql import table, column
info_table = None
class CaseT... | 31.375661 | 78 | 0.417707 | from sqlalchemy.testing import assert_raises, eq_
from sqlalchemy.testing import fixtures, AssertsCompiledSQL
from sqlalchemy import (
testing, exc, case, select, literal_column, text, and_, Integer, cast,
String, Column, Table, MetaData)
from sqlalchemy.sql import table, column
info_table = None
class CaseT... | true | true |
f7025b8b75bfdaa2c9f531221732fb0a9450c662 | 6,087 | py | Python | sdks/python/apache_beam/runners/interactive/user_pipeline_tracker_test.py | NarimanAB/beam | 6cedbac5bb42304f4af88634edd276b0b78e4e4e | [
"Apache-2.0",
"BSD-3-Clause"
] | 5,279 | 2016-12-29T04:00:44.000Z | 2022-03-31T22:56:45.000Z | sdks/python/apache_beam/runners/interactive/user_pipeline_tracker_test.py | NarimanAB/beam | 6cedbac5bb42304f4af88634edd276b0b78e4e4e | [
"Apache-2.0",
"BSD-3-Clause"
] | 14,149 | 2016-12-28T00:43:50.000Z | 2022-03-31T23:50:22.000Z | sdks/python/apache_beam/runners/interactive/user_pipeline_tracker_test.py | NarimanAB/beam | 6cedbac5bb42304f4af88634edd276b0b78e4e4e | [
"Apache-2.0",
"BSD-3-Clause"
] | 3,763 | 2016-12-29T04:06:10.000Z | 2022-03-31T22:25:49.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 29.264423 | 85 | 0.730738 |
import unittest
import apache_beam as beam
from apache_beam.runners.interactive.user_pipeline_tracker import UserPipelineTracker
class UserPipelineTrackerTest(unittest.TestCase):
def test_getting_unknown_pid_returns_none(self):
ut = UserPipelineTracker()
p = beam.Pipeline()
self.asse... | true | true |
f7025c78c757691bec4e0501ffe984904b95dd4a | 619 | py | Python | Python/PYHTON/Variaveis/DSA - Variaveis.py | ccpn1988/Python | 94c84aa6f3ef9d05d64c3d87212dfd67694f4544 | [
"MIT"
] | null | null | null | Python/PYHTON/Variaveis/DSA - Variaveis.py | ccpn1988/Python | 94c84aa6f3ef9d05d64c3d87212dfd67694f4544 | [
"MIT"
] | null | null | null | Python/PYHTON/Variaveis/DSA - Variaveis.py | ccpn1988/Python | 94c84aa6f3ef9d05d64c3d87212dfd67694f4544 | [
"MIT"
] | null | null | null | # VARIAVEIS
# ATRIBUINDO VALOR A UMA VARIAVEL
var_teste = 1
print(var_teste)
print(type(var_teste))
#DECLARAÇÂO MULTIPLA
pessoa1, pessoa2, pessoa3 = 'Jose', 'Joao','Maria'
print(pessoa1)
print(pessoa2)
print(pessoa3)
# VARIAVEL COM ATRIBUIÇÃO
pessoa1=pessoa2=pessoa3 = 'Jose'
print(pessoa1)
print(pessoa2)
print(pesso... | 19.967742 | 50 | 0.74475 |
var_teste = 1
print(var_teste)
print(type(var_teste))
pessoa1, pessoa2, pessoa3 = 'Jose', 'Joao','Maria'
print(pessoa1)
print(pessoa2)
print(pessoa3)
pessoa1=pessoa2=pessoa3 = 'Jose'
print(pessoa1)
print(pessoa2)
print(pessoa3)
idade = 32
idade1 = 28
print('SOMA',idade + idade1)
print('SUBTRAÇÃO',idade - idad... | true | true |
f7025d49566233267aee5f1e01b03afd40276ac2 | 8,674 | py | Python | rrd/view/screen.py | schemacs/falcon-dashboard | 4d2b387a3e9f12994a54e5d2bcf8acd723710fd6 | [
"Apache-2.0"
] | 1 | 2016-06-04T13:23:43.000Z | 2016-06-04T13:23:43.000Z | rrd/view/screen.py | smokeman/dashboard | 35dbee7bc06d294a32ecba18a62395e320dcfb8a | [
"Apache-2.0"
] | null | null | null | rrd/view/screen.py | smokeman/dashboard | 35dbee7bc06d294a32ecba18a62395e320dcfb8a | [
"Apache-2.0"
] | null | null | null | #-*- coding:utf-8 -*-
import json
import copy
import requests
import json
from flask import render_template, abort, request, url_for, redirect, g
import time
import datetime
from rrd import app
from rrd.model.screen import DashboardScreen
from rrd.model.graph import DashboardGraph
from rrd import consts
from rrd.utils... | 32.00738 | 114 | 0.61056 |
import json
import copy
import requests
import json
from flask import render_template, abort, request, url_for, redirect, g
import time
import datetime
from rrd import app
from rrd.model.screen import DashboardScreen
from rrd.model.graph import DashboardGraph
from rrd import consts
from rrd.utils.graph_urls import ge... | true | true |
f7025d79335469b2af7d433c0a5238418c81123d | 2,973 | py | Python | ogbg-code/model/asap.py | anonyma2020/dagnn | 3191b2cc4f923d523ece3962c96a0e3dd54f1a0b | [
"MIT"
] | 38 | 2021-01-24T13:33:31.000Z | 2022-03-29T02:24:32.000Z | ogbg-code/model/asap.py | anonyma2020/dagnn | 3191b2cc4f923d523ece3962c96a0e3dd54f1a0b | [
"MIT"
] | 3 | 2021-03-10T08:00:58.000Z | 2021-11-02T08:29:02.000Z | ogbg-code/model/asap.py | anonyma2020/dagnn | 3191b2cc4f923d523ece3962c96a0e3dd54f1a0b | [
"MIT"
] | 9 | 2021-02-20T14:39:34.000Z | 2022-03-17T01:51:03.000Z | import torch
import torch.nn.functional as F
from torch.nn import Linear
from torch_geometric.nn import (ASAPooling,
GraphConv, global_mean_pool,
JumpingKnowledge)
class ASAP(torch.nn.Module):
def __init__(self, num_vocab, max_seq_len, node_encoder, ... | 36.256098 | 125 | 0.590649 | import torch
import torch.nn.functional as F
from torch.nn import Linear
from torch_geometric.nn import (ASAPooling,
GraphConv, global_mean_pool,
JumpingKnowledge)
class ASAP(torch.nn.Module):
def __init__(self, num_vocab, max_seq_len, node_encoder, ... | true | true |
f7025e482326addd111e4b18afa939b10069bdad | 1,745 | py | Python | catkin_ws/src/dagu_car/src/wheels_cmd_switch_node.py | OSLL/Dickietown-Software | fcbca82cae9a8076c30c6a21c93b729bb8c01eca | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/dagu_car/src/wheels_cmd_switch_node.py | OSLL/Dickietown-Software | fcbca82cae9a8076c30c6a21c93b729bb8c01eca | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/dagu_car/src/wheels_cmd_switch_node.py | OSLL/Dickietown-Software | fcbca82cae9a8076c30c6a21c93b729bb8c01eca | [
"CC-BY-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
from duckietown_msgs.msg import WheelsCmdStamped, FSMState
class WheelsCmdSwitchNode(object):
def __init__(self):
self.node_name = rospy.get_name()
rospy.loginfo("[%s] Initializing " %(self.node_name))
# Read parameters
self.mappings = rospy.get_para... | 39.659091 | 128 | 0.694556 |
import rospy
from duckietown_msgs.msg import WheelsCmdStamped, FSMState
class WheelsCmdSwitchNode(object):
def __init__(self):
self.node_name = rospy.get_name()
rospy.loginfo("[%s] Initializing " %(self.node_name))
self.mappings = rospy.get_param("~mappings")
source_topic_di... | true | true |
f70260b8d341e2802090c4507199d8c9a2de5f03 | 2,788 | py | Python | alipay/aop/api/domain/AlipayTradeSettleReceivablesQueryModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 1 | 2022-03-07T06:11:10.000Z | 2022-03-07T06:11:10.000Z | alipay/aop/api/domain/AlipayTradeSettleReceivablesQueryModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayTradeSettleReceivablesQueryModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 1 | 2021-10-05T03:01:09.000Z | 2021-10-05T03:01:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.SettleEntity import SettleEntity
class AlipayTradeSettleReceivablesQueryModel(object):
def __init__(self):
self._biz_product = None
self._extend_params = None... | 30.977778 | 79 | 0.625897 |
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.SettleEntity import SettleEntity
class AlipayTradeSettleReceivablesQueryModel(object):
def __init__(self):
self._biz_product = None
self._extend_params = None
self._merchant_info = None
... | true | true |
f70261b694fca9802548a912f945ff89a5035eca | 2,782 | py | Python | src/state.py | xeust/Method-Draw | a8b264e37fdc3a3a8b629178d62ecb6c8008760b | [
"MIT"
] | 7 | 2021-07-25T23:38:31.000Z | 2021-12-04T23:11:57.000Z | src/state.py | xeust/Method-Draw | a8b264e37fdc3a3a8b629178d62ecb6c8008760b | [
"MIT"
] | null | null | null | src/state.py | xeust/Method-Draw | a8b264e37fdc3a3a8b629178d62ecb6c8008760b | [
"MIT"
] | 5 | 2021-08-11T12:02:10.000Z | 2022-02-24T04:41:09.000Z | import os
from deta import Deta
from datetime import date, datetime
from fastapi import HTTPException
import urllib
import base64
deta = Deta()
base = deta.Base("drawings")
drive = deta.Drive("drawings")
def get_all(db, query):
blob_gen = db.fetch(query)
blobs = []
for stored_blob in blob_gen:
... | 27.82 | 127 | 0.62509 | import os
from deta import Deta
from datetime import date, datetime
from fastapi import HTTPException
import urllib
import base64
deta = Deta()
base = deta.Base("drawings")
drive = deta.Drive("drawings")
def get_all(db, query):
blob_gen = db.fetch(query)
blobs = []
for stored_blob in blob_gen:
... | true | true |
f70262ad5923fa3e4e49cdaa62ec5bb20a7a390f | 6,835 | py | Python | qiskit/providers/aer/library/save_amplitudes.py | ArunRamachandran25/qiskit-aer | 0ece80f11d61193f74b639b3efb82253fedeaef1 | [
"Apache-2.0"
] | 1 | 2021-02-25T16:56:19.000Z | 2021-02-25T16:56:19.000Z | qiskit/providers/aer/library/save_amplitudes.py | ArunRamachandran25/qiskit-aer | 0ece80f11d61193f74b639b3efb82253fedeaef1 | [
"Apache-2.0"
] | null | null | null | qiskit/providers/aer/library/save_amplitudes.py | ArunRamachandran25/qiskit-aer | 0ece80f11d61193f74b639b3efb82253fedeaef1 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 41.932515 | 84 | 0.593416 |
from qiskit.circuit import QuantumCircuit
from qiskit.extensions.exceptions import ExtensionError
from .save_data import SaveSingleData, SaveAverageData, default_qubits
class SaveAmplitudes(SaveSingleData):
def __init__(self,
key,
num_qubits,
params,
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.