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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1cda18bdf17d193d94ce6f0af0cd7117f67f8c | 27,204 | py | Python | src/_pytest/main.py | isidentical/pytest | cc283cfe79b9ab97edd2d10fb05d217ff498b809 | [
"MIT"
] | null | null | null | src/_pytest/main.py | isidentical/pytest | cc283cfe79b9ab97edd2d10fb05d217ff498b809 | [
"MIT"
] | null | null | null | src/_pytest/main.py | isidentical/pytest | cc283cfe79b9ab97edd2d10fb05d217ff498b809 | [
"MIT"
] | null | null | null | """ core implementation of testing process: init, session, runtest loop. """
import fnmatch
import functools
import importlib
import os
import sys
from typing import Callable
from typing import Dict
from typing import FrozenSet
from typing import Iterator
from typing import List
from typing import Optional
from typing ... | 36.911805 | 109 | 0.599875 | import fnmatch
import functools
import importlib
import os
import sys
from typing import Callable
from typing import Dict
from typing import FrozenSet
from typing import Iterator
from typing import List
from typing import Optional
from typing import Sequence
from typing import Set
from typing import Tuple
from typing i... | true | true |
1c1cda6eed63cd19c645a4beacc7886be552c6a1 | 4,474 | py | Python | tests/test_python.py | andredias/codebox | f9aeddb98fde1a33b3dc6fbec8b0725198de042f | [
"MIT"
] | null | null | null | tests/test_python.py | andredias/codebox | f9aeddb98fde1a33b3dc6fbec8b0725198de042f | [
"MIT"
] | 21 | 2021-04-13T22:38:37.000Z | 2021-05-18T15:41:14.000Z | tests/test_python.py | andredias/codebox | f9aeddb98fde1a33b3dc6fbec8b0725198de042f | [
"MIT"
] | null | null | null | from httpx import AsyncClient
from pydantic import parse_obj_as
from pytest import fixture, mark
from app.config import CGROUP_MEM_MAX, TIMEOUT
from app.models import Command, ProjectCore, Response
@fixture
def run_python(client: AsyncClient):
async def _run_python(code: str) -> Response:
sources = {'tes... | 29.434211 | 96 | 0.614439 | from httpx import AsyncClient
from pydantic import parse_obj_as
from pytest import fixture, mark
from app.config import CGROUP_MEM_MAX, TIMEOUT
from app.models import Command, ProjectCore, Response
@fixture
def run_python(client: AsyncClient):
async def _run_python(code: str) -> Response:
sources = {'tes... | true | true |
1c1cdae132d4fd61d9f6eb7e20de838ceec6615b | 18,542 | py | Python | maqluengine/migrations/0002_auto__add_field_formtype_template_json.py | robcbryant/projectanka | 54d713693a9e618bfa96c7d784563bc72fa0a8f8 | [
"Apache-2.0"
] | null | null | null | maqluengine/migrations/0002_auto__add_field_formtype_template_json.py | robcbryant/projectanka | 54d713693a9e618bfa96c7d784563bc72fa0a8f8 | [
"Apache-2.0"
] | null | null | null | maqluengine/migrations/0002_auto__add_field_formtype_template_json.py | robcbryant/projectanka | 54d713693a9e618bfa96c7d784563bc72fa0a8f8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'FormType.template_json'
db.add_column(u'maqluengine_formt... | 97.078534 | 234 | 0.588502 |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column(u'maqluengine_formtype', 'template_json',
self.gf('django.d... | true | true |
1c1cdae4f1283534bb95005f8654e3f71c52ee13 | 5,833 | py | Python | graphcsv.py | trohit/stackedBarChart | 8e8c2ee542f87e8ad7fefe648dec712abeaef1fe | [
"MIT"
] | null | null | null | graphcsv.py | trohit/stackedBarChart | 8e8c2ee542f87e8ad7fefe648dec712abeaef1fe | [
"MIT"
] | null | null | null | graphcsv.py | trohit/stackedBarChart | 8e8c2ee542f87e8ad7fefe648dec712abeaef1fe | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 4 10:15:48 2020
@author: rohit
python3.7 ./graphcsv.py -i /tmp/linuxmem_a.csv --offset 5 --vxdate "Apr 06 11:04:50" --vpct 20 --vtitle "report gen started"
date,drname,cpupct,curmem,maxmem,mempct,netrx,nettx
Apr 06 11:00:37,ubuntu_docker,26.52,5... | 34.720238 | 124 | 0.629865 |
import csv
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.dates as md
import dateutil
import sys
import os
import argparse
def extract_datetime(dt_str):
print("parsing date:" + dt_str)
dt = dateutil.parser.parse(dt_str)
return dt
def is_header_in_row(row):
if row[0].isalpha():
... | true | true |
1c1cdb05db7175fa83b7a707b0e0a4fa4fe7e6ec | 321 | py | Python | tests/beta_tests/test_doing_your_taxes.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | tests/beta_tests/test_doing_your_taxes.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | tests/beta_tests/test_doing_your_taxes.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | import unittest
from katas.beta.doing_your_taxes import tax
class TaxTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(tax(1.2), 1.26)
def test_equals_2(self):
self.assertEqual(tax(100), 105)
def test_equals_3(self):
self.assertEqual(tax('Hello'), 'Error 404')... | 21.4 | 51 | 0.685358 | import unittest
from katas.beta.doing_your_taxes import tax
class TaxTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(tax(1.2), 1.26)
def test_equals_2(self):
self.assertEqual(tax(100), 105)
def test_equals_3(self):
self.assertEqual(tax('Hello'), 'Error 404')... | true | true |
1c1cdb64f30aaec77ac4d7ed5a8cebfe4c1127da | 12,189 | py | Python | src/game_objects/character.py | IUS-CS/BearsOnUnicycles | 7615b15e481046e05bd24f5d574ac92bff4650f0 | [
"Apache-2.0"
] | 5 | 2018-01-30T22:56:49.000Z | 2021-02-17T02:20:49.000Z | src/game_objects/character.py | IUS-CS/BearsOnUnicycles | 7615b15e481046e05bd24f5d574ac92bff4650f0 | [
"Apache-2.0"
] | 11 | 2018-01-30T21:43:01.000Z | 2018-04-19T04:32:56.000Z | src/game_objects/character.py | IUS-CS/BearsOnUnicycles | 7615b15e481046e05bd24f5d574ac92bff4650f0 | [
"Apache-2.0"
] | 3 | 2018-10-04T22:37:45.000Z | 2019-07-30T23:43:07.000Z | # File: character.py
# Authors: BearsOnUnicycles
# Since: 4/7/18
# This is the base class for all characters in the game and should be inherited from for each individual character
from src import engine
class State:
title = ""
next = None
change = False
frames = 0
counter = 1
def __init__(s... | 33.394521 | 133 | 0.572565 |
from src import engine
class State:
title = ""
next = None
change = False
frames = 0
counter = 1
def __init__(self, title, next, frames):
self.title = title
self.next = next
self.frames = frames
self.change = False
self.counter = 1
def set_ne... | true | true |
1c1cdc590df8e421aacb73a128fff45f11a418a0 | 3,350 | py | Python | lp_generators/writers.py | simonbowly/lp-generators | 937c44074c234333b6a5408c3e18f498c2205948 | [
"MIT"
] | 9 | 2020-01-02T23:07:36.000Z | 2022-01-26T10:04:04.000Z | lp_generators/writers.py | simonbowly/lp-generators | 937c44074c234333b6a5408c3e18f498c2205948 | [
"MIT"
] | null | null | null | lp_generators/writers.py | simonbowly/lp-generators | 937c44074c234333b6a5408c3e18f498c2205948 | [
"MIT"
] | 1 | 2020-01-02T23:08:26.000Z | 2020-01-02T23:08:26.000Z | ''' Write instance data in various formats. Supports MPS for external use of
generated instances and a tar format used internally to read and write
instance data for generation and search where required. '''
import io
import tarfile
import numpy as np
from .lp_ext import LPCy
from .instance import EncodedInstance, U... | 38.505747 | 83 | 0.705672 |
import io
import tarfile
import numpy as np
from .lp_ext import LPCy
from .instance import EncodedInstance, UnsolvedInstance
def write_mps(instance, file_name):
writer = LPCy()
writer.construct_dense_canonical(
instance.variables, instance.constraints,
np.asarray(instance.lhs()),
np... | true | true |
1c1cdced5bdd308da33b5f0fdbac704380db9693 | 10,739 | py | Python | Pymol_scripts/Draw_rotation_axis.py | soothing35/cryoEM_annealling | 212beaf23fe287d69571582fdbadc736f1abf908 | [
"MIT"
] | null | null | null | Pymol_scripts/Draw_rotation_axis.py | soothing35/cryoEM_annealling | 212beaf23fe287d69571582fdbadc736f1abf908 | [
"MIT"
] | null | null | null | Pymol_scripts/Draw_rotation_axis.py | soothing35/cryoEM_annealling | 212beaf23fe287d69571582fdbadc736f1abf908 | [
"MIT"
] | null | null | null | '''
Modified from:
http://pymolwiki.org/index.php/RotationAxis
An extra function, auto_draw_axis, was added, to calculate the rotational angles among bunch of structures (line 267)
'''
from __future__ import print_function
__author__ = 'Pablo Guardado Calvo'
__version__ = '0.1'
__email__ = 'pablo.guardado (at) gm... | 38.217082 | 170 | 0.59689 |
from __future__ import print_function
__author__ = 'Pablo Guardado Calvo'
__version__ = '0.1'
__email__ = 'pablo.guardado (at) gmail.com'
from pymol import cmd, cgo
import math
import numpy
def transf_matrix(chA, chB):
cmd.create('working', chA)
cmd.super('working', chB)
T = cmd.get_object_matrix(... | true | true |
1c1cdd2b1ec4b560d558860187e2c84e52968f57 | 4,391 | py | Python | vampire/common/allennlp_bridge.py | SparkJiao/vampire | 52858f9b2922415b25d95ce619993e21e16dd620 | [
"Apache-2.0"
] | 177 | 2019-06-10T22:02:38.000Z | 2022-03-31T12:36:40.000Z | vampire/common/allennlp_bridge.py | SparkJiao/vampire | 52858f9b2922415b25d95ce619993e21e16dd620 | [
"Apache-2.0"
] | 31 | 2019-06-10T21:01:18.000Z | 2021-09-09T22:39:17.000Z | vampire/common/allennlp_bridge.py | SparkJiao/vampire | 52858f9b2922415b25d95ce619993e21e16dd620 | [
"Apache-2.0"
] | 35 | 2019-06-11T02:08:39.000Z | 2021-11-30T20:00:23.000Z | import codecs
import logging
import os
from typing import Iterable
from allennlp.common.file_utils import cached_path
from allennlp.common.params import Params
from allennlp.common.util import namespace_match
from allennlp.data import instance as adi # pylint: disable=unused-import
from allennlp.data.vocabulary impor... | 41.037383 | 106 | 0.653154 | import codecs
import logging
import os
from typing import Iterable
from allennlp.common.file_utils import cached_path
from allennlp.common.params import Params
from allennlp.common.util import namespace_match
from allennlp.data import instance as adi
from allennlp.data.vocabulary import Vocabulary
from overrides imp... | true | true |
1c1cdec51f37c92febc3016cca8f58d4c6829958 | 203 | py | Python | aitoolbox/torchtrain/train_loop/__init__.py | mv1388/AIToolbox | c64ac4810a02d230ce471d86b758e82ea232a7e7 | [
"MIT"
] | 3 | 2019-10-12T12:24:09.000Z | 2020-08-02T02:42:43.000Z | aitoolbox/torchtrain/train_loop/__init__.py | mv1388/aitoolbox | 1060435e6cbdfd19abcb726c4080b663536b7467 | [
"MIT"
] | 3 | 2020-04-10T14:07:07.000Z | 2020-04-22T19:04:38.000Z | aitoolbox/torchtrain/train_loop/__init__.py | mv1388/aitoolbox | 1060435e6cbdfd19abcb726c4080b663536b7467 | [
"MIT"
] | null | null | null | from aitoolbox.torchtrain.train_loop.train_loop import TrainLoop
from aitoolbox.torchtrain.train_loop.train_loop_tracking import (
TrainLoopCheckpoint, TrainLoopEndSave, TrainLoopCheckpointEndSave
)
| 40.6 | 69 | 0.871921 | from aitoolbox.torchtrain.train_loop.train_loop import TrainLoop
from aitoolbox.torchtrain.train_loop.train_loop_tracking import (
TrainLoopCheckpoint, TrainLoopEndSave, TrainLoopCheckpointEndSave
)
| true | true |
1c1cdf32049e5474a7fd370b9f1c39d77a785955 | 29,600 | py | Python | sql/query.py | jiangming1/archery | e05c06ee18eb2c967fd49b4b5a72d271abcccbe4 | [
"Apache-2.0"
] | null | null | null | sql/query.py | jiangming1/archery | e05c06ee18eb2c967fd49b4b5a72d271abcccbe4 | [
"Apache-2.0"
] | null | null | null | sql/query.py | jiangming1/archery | e05c06ee18eb2c967fd49b4b5a72d271abcccbe4 | [
"Apache-2.0"
] | 1 | 2019-05-29T11:22:40.000Z | 2019-05-29T11:22:40.000Z | # -*- coding: UTF-8 -*-
import datetime
import logging
import re
import time
import traceback
import simplejson as json
from django.contrib.auth.decorators import permission_required
from django.core import serializers
from django.db import connection
from django.db import transaction
from django.db.models import Q, M... | 45.259939 | 134 | 0.584291 |
import datetime
import logging
import re
import time
import traceback
import simplejson as json
from django.contrib.auth.decorators import permission_required
from django.core import serializers
from django.db import connection
from django.db import transaction
from django.db.models import Q, Min
from django.http imp... | true | true |
1c1cdf523b08dc2c94c0feba11d15ecfe5199e7c | 186 | py | Python | lesson8_netconf/ex2a.py | anejolazaro70/python_july19 | d4fd2f0d00d22f2f103ef9fe9c289c8b0651b454 | [
"Apache-2.0"
] | null | null | null | lesson8_netconf/ex2a.py | anejolazaro70/python_july19 | d4fd2f0d00d22f2f103ef9fe9c289c8b0651b454 | [
"Apache-2.0"
] | null | null | null | lesson8_netconf/ex2a.py | anejolazaro70/python_july19 | d4fd2f0d00d22f2f103ef9fe9c289c8b0651b454 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from jnpr.junos import Device
from jnpr_devices import srx2
from pprint import pprint
device = Device(**srx2)
device.open()
pprint(device.facts.get('hostname'))
| 16.909091 | 36 | 0.763441 |
from jnpr.junos import Device
from jnpr_devices import srx2
from pprint import pprint
device = Device(**srx2)
device.open()
pprint(device.facts.get('hostname'))
| true | true |
1c1ce09032fecae3226b53521d29db3346f84993 | 12,719 | py | Python | src/tests/test_convergence_checker.py | ghackebeil/pybnb | 1f69b0684cfbe83d69ca1be00641ce438cbc3d7b | [
"MIT"
] | 41 | 2018-11-13T03:03:22.000Z | 2022-03-07T13:22:56.000Z | src/tests/test_convergence_checker.py | ghackebeil/pybnb | 1f69b0684cfbe83d69ca1be00641ce438cbc3d7b | [
"MIT"
] | 16 | 2019-01-15T04:38:27.000Z | 2020-12-08T16:14:43.000Z | src/tests/test_convergence_checker.py | ghackebeil/pybnb | 1f69b0684cfbe83d69ca1be00641ce438cbc3d7b | [
"MIT"
] | 9 | 2019-06-07T04:21:27.000Z | 2022-03-07T13:22:57.000Z | import itertools
import math
from pybnb.common import minimize, maximize, inf, TerminationCondition
from pybnb.convergence_checker import ConvergenceChecker
class TestConvergenceChecker(object):
def test_sense(self):
# min
p = ConvergenceChecker(minimize)
assert p.sense == minimize
... | 41.838816 | 87 | 0.621275 | import itertools
import math
from pybnb.common import minimize, maximize, inf, TerminationCondition
from pybnb.convergence_checker import ConvergenceChecker
class TestConvergenceChecker(object):
def test_sense(self):
p = ConvergenceChecker(minimize)
assert p.sense == minimize
... | true | true |
1c1ce1380cf932fa5bfb271bcdc188b784159eef | 139 | py | Python | third_party/universal-ctags/ctags/Units/parser-python.r/bug1988027.py.d/input.py | f110/wing | 31b259f723b57a6481252a4b8b717fcee6b01ff4 | [
"MIT"
] | 4 | 2017-02-07T20:04:31.000Z | 2022-01-30T14:04:45.000Z | third_party/universal-ctags/ctags/Units/parser-python.r/bug1988027.py.d/input.py | f110/wing | 31b259f723b57a6481252a4b8b717fcee6b01ff4 | [
"MIT"
] | 1 | 2018-01-07T19:14:53.000Z | 2018-01-07T19:14:53.000Z | third_party/universal-ctags/ctags/Units/parser-python.r/bug1988027.py.d/input.py | f110/wing | 31b259f723b57a6481252a4b8b717fcee6b01ff4 | [
"MIT"
] | 1 | 2021-04-26T09:00:06.000Z | 2021-04-26T09:00:06.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
bla
#"""
"""make a tarball with all the sources in it; return (distdirname, tarballname)"""
| 13.9 | 82 | 0.654676 | true | true | |
1c1ce2327093bd406ee5a6284a9c6e9e861c6c41 | 1,416 | py | Python | validators/domain.py | vphilippon/validators | 1dd07ab19aed7dd1c61ce04eac0e59807aa6e39c | [
"MIT"
] | 7 | 2022-01-16T12:28:16.000Z | 2022-03-04T15:31:45.000Z | validators/domain.py | vphilippon/validators | 1dd07ab19aed7dd1c61ce04eac0e59807aa6e39c | [
"MIT"
] | 10 | 2021-06-16T20:48:32.000Z | 2021-10-04T18:22:02.000Z | validators/domain.py | vphilippon/validators | 1dd07ab19aed7dd1c61ce04eac0e59807aa6e39c | [
"MIT"
] | 1 | 2021-03-30T05:02:53.000Z | 2021-03-30T05:02:53.000Z | import re
import six
from .utils import validator
if six.PY3:
text_type = str
unicode = str
else:
text_type = unicode
pattern = re.compile(
r'^(?:[a-zA-Z0-9]' # First character of the domain
r'(?:[a-zA-Z0-9-_]{0,61}[A-Za-z0-9])?\.)' # Sub domain + hostname
r'+[A-Za-z0-9][A-Za-z0-9-_]{0,61}... | 22.47619 | 79 | 0.617938 | import re
import six
from .utils import validator
if six.PY3:
text_type = str
unicode = str
else:
text_type = unicode
pattern = re.compile(
r'^(?:[a-zA-Z0-9]'
r'(?:[a-zA-Z0-9-_]{0,61}[A-Za-z0-9])?\.)'
r'+[A-Za-z0-9][A-Za-z0-9-_]{0,61}'
r'[A-Za-z]$'
)
def to_unicode(obj, charset... | true | true |
1c1ce2dd0b23b73087c24e13c3ccdfdc47d4c372 | 4,890 | py | Python | smolDM/client.py | andreheringer/smolDM | 6486048293a0f1dda71ce3d88f361cb9c3a524d5 | [
"MIT"
] | 4 | 2020-04-01T01:11:49.000Z | 2021-04-14T11:42:01.000Z | smolDM/client.py | andreheringer/smolDM | 6486048293a0f1dda71ce3d88f361cb9c3a524d5 | [
"MIT"
] | 6 | 2020-04-22T20:56:25.000Z | 2020-04-22T20:56:27.000Z | smolDM/client.py | andreheringer/crael | 6486048293a0f1dda71ce3d88f361cb9c3a524d5 | [
"MIT"
] | null | null | null | """
This module defines the Discord Clint interface.
:copywrite: Andre Heringer 2018-2019
:license: MIT, see license for details
"""
import asyncio
import discord
from pathlib import Path
from typing import Optional
from loguru import logger
import smolDM.commands as cmd
import smolDM.compass as compass
import smolD... | 30 | 85 | 0.624949 |
import asyncio
import discord
from pathlib import Path
from typing import Optional
from loguru import logger
import smolDM.commands as cmd
import smolDM.compass as compass
import smolDM.scenes as scene
import smolDM.session as session
class DiscordClient(discord.Client):
def __init__(self):
self._comm... | true | true |
1c1ce31028a811c993a2abac9e1b33e6778c80f4 | 322 | py | Python | theoldreader/__init__.py | kusinkay/theoldreader | 8668f8872a6d013cb8449dae28ad5b85b9112ddd | [
"MIT"
] | 13 | 2015-06-08T03:12:03.000Z | 2022-01-28T02:15:04.000Z | theoldreader/__init__.py | kusinkay/theoldreader | 8668f8872a6d013cb8449dae28ad5b85b9112ddd | [
"MIT"
] | 6 | 2015-07-15T19:51:28.000Z | 2015-09-22T03:07:00.000Z | theoldreader/__init__.py | kusinkay/theoldreader | 8668f8872a6d013cb8449dae28ad5b85b9112ddd | [
"MIT"
] | 6 | 2015-07-15T10:57:58.000Z | 2021-09-29T21:43:24.000Z | # -*- coding: UTF-8 -*-
""" A python wrapper for making calls to the TheOldReader API """
__author__ = "Qra"
# TODO: added author email
__email__ = ""
__copyright__ = "Copyright (C) 2015, Kurochkin Vasiliy"
__license__ = "MIT"
__version__ = "0.1.0"
__date__ = "2015-08-25"
from .tor import Connection, ItemsSearch, Ite... | 24.769231 | 65 | 0.698758 |
__author__ = "Qra"
__email__ = ""
__copyright__ = "Copyright (C) 2015, Kurochkin Vasiliy"
__license__ = "MIT"
__version__ = "0.1.0"
__date__ = "2015-08-25"
from .tor import Connection, ItemsSearch, Item
| true | true |
1c1ce330ff2a6ef3b92ba691786394868b5e2f19 | 1,941 | py | Python | training code/salinas/mdcpe/code/predict_unlabel.py | littlejgogo/MDCPE-co-training-method-for-hyperspectral-image-classification | b7d367abd97ada77adc45a1120149cf247f9713c | [
"Apache-2.0"
] | 4 | 2018-12-08T08:15:23.000Z | 2020-10-07T10:00:22.000Z | training code/salinas/mdcpe/code/predict_unlabel.py | littlejgogo/MDCPE-co-training-method-for-hyperspectral-image-classification | b7d367abd97ada77adc45a1120149cf247f9713c | [
"Apache-2.0"
] | null | null | null | training code/salinas/mdcpe/code/predict_unlabel.py | littlejgogo/MDCPE-co-training-method-for-hyperspectral-image-classification | b7d367abd97ada77adc45a1120149cf247f9713c | [
"Apache-2.0"
] | 6 | 2019-01-11T17:01:49.000Z | 2022-02-05T04:48:59.000Z | import tensorflow as tf
class Predict(object):
def __init__(self, path1, path2):
self.graph = tf.Graph()
with self.graph.as_default():
self.saver = tf.train.import_meta_graph(path1)
self.sess = tf.Session(graph=self.graph)
with self.sess.as_default():
with se... | 45.139535 | 103 | 0.617208 | import tensorflow as tf
class Predict(object):
def __init__(self, path1, path2):
self.graph = tf.Graph()
with self.graph.as_default():
self.saver = tf.train.import_meta_graph(path1)
self.sess = tf.Session(graph=self.graph)
with self.sess.as_default():
with se... | true | true |
1c1ce5646d4584f98547af8d1a7576c24fc2b9cf | 9,380 | py | Python | s3prl/downstream/mosei/expert.py | Ethan07902050/s3prl | 854aff0b3062fc2cff531401923b8745f64701e7 | [
"MIT"
] | null | null | null | s3prl/downstream/mosei/expert.py | Ethan07902050/s3prl | 854aff0b3062fc2cff531401923b8745f64701e7 | [
"MIT"
] | 2 | 2021-12-08T14:52:39.000Z | 2021-12-12T09:33:08.000Z | s3prl/downstream/mosei/expert.py | tarepan/s3prl | e120e29a59e5b4f6a1e9d7946602070567301938 | [
"MIT"
] | null | null | null | import os
# import math
import torch
# import random
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.nn.utils.rnn import pad_sequence
from .model import Model
from .dataset import MOSEIDataset
import pandas as pd
# import sys
from collections import defaultdict
import sklear... | 35.530303 | 86 | 0.587846 | import os
import torch
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.nn.utils.rnn import pad_sequence
from .model import Model
from .dataset import MOSEIDataset
import pandas as pd
from collections import defaultdict
import sklearn
from pathlib import Path
class Down... | true | true |
1c1ce5e84557fda1b74f6030e483ff3ba618c4fe | 2,316 | py | Python | src/app/routers/users.py | jtprogru/todoister | 7db767efad8f9de79974b86464f485bb9365f84e | [
"MIT"
] | 1 | 2021-08-11T23:31:51.000Z | 2021-08-11T23:31:51.000Z | src/app/routers/users.py | jtprogru/todoister | 7db767efad8f9de79974b86464f485bb9365f84e | [
"MIT"
] | 7 | 2021-08-15T19:15:45.000Z | 2021-10-11T04:13:50.000Z | src/app/routers/users.py | jtprogru/todoister | 7db767efad8f9de79974b86464f485bb9365f84e | [
"MIT"
] | null | null | null | """Модуль предоставляющий users_router."""
from typing import List, Optional
from fastapi import APIRouter
from fastapi.params import Depends
from app.core import SessionLocal
from app.schemas import User, UserCreate
from app.services import db_services, users_services
users_router = APIRouter(
prefix='/users',... | 30.88 | 88 | 0.728411 |
from typing import List, Optional
from fastapi import APIRouter
from fastapi.params import Depends
from app.core import SessionLocal
from app.schemas import User, UserCreate
from app.services import db_services, users_services
users_router = APIRouter(
prefix='/users',
tags=['users'],
)
depends_db = Depend... | true | true |
1c1ce81e98e44910f53664fd2d6e2d8f03619b47 | 441 | py | Python | src/617D.py | viing937/codeforces | d694eb6967cd56af02963c3a662066048cb78d07 | [
"MIT"
] | 2 | 2016-08-19T09:47:03.000Z | 2016-10-01T10:15:03.000Z | src/617D.py | viing937/codeforces | d694eb6967cd56af02963c3a662066048cb78d07 | [
"MIT"
] | null | null | null | src/617D.py | viing937/codeforces | d694eb6967cd56af02963c3a662066048cb78d07 | [
"MIT"
] | 1 | 2015-07-01T23:57:32.000Z | 2015-07-01T23:57:32.000Z | def f(a, b, c):
return (x[a] == x[b] and (y[c] <= min(y[a], y[b]) or y[c] >= max(y[a], y[b]))) or\
(y[a] == y[b] and (x[c] <= min(x[a], x[b]) or x[c] >= max(x[a], x[b])))
x, y = list(zip(*[list(map(int, input().split(' '))) for i in range(3)]))
if len(set(x)) == 1 or len(set(y)) == 1:
print(1)
elif... | 31.5 | 86 | 0.430839 | def f(a, b, c):
return (x[a] == x[b] and (y[c] <= min(y[a], y[b]) or y[c] >= max(y[a], y[b]))) or\
(y[a] == y[b] and (x[c] <= min(x[a], x[b]) or x[c] >= max(x[a], x[b])))
x, y = list(zip(*[list(map(int, input().split(' '))) for i in range(3)]))
if len(set(x)) == 1 or len(set(y)) == 1:
print(1)
elif... | true | true |
1c1ce85ffaf3880f9f7b563b436db158921c66cd | 4,054 | py | Python | train.py | rtaiello/learning-to-learn | 2f6f420f05f9be97671a7c8811db64de9383a6eb | [
"Apache-2.0"
] | null | null | null | train.py | rtaiello/learning-to-learn | 2f6f420f05f9be97671a7c8811db64de9383a6eb | [
"Apache-2.0"
] | null | null | null | train.py | rtaiello/learning-to-learn | 2f6f420f05f9be97671a7c8811db64de9383a6eb | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 34.355932 | 80 | 0.673162 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from six.moves import xrange
import tensorflow as tf
from tqdm import tqdm
from tensorflow.contrib.learn.python.learn import monitored_session as ms
import meta
import util
flags = t... | true | true |
1c1ce8a488bd2bb23a13ebfc6e1d68965c1fc32d | 348 | py | Python | a2ml/tasks_queue/config.py | augerai/a2ml | 9d9ce0ac1b51cc81f1cb5ae331c4523131bc6a86 | [
"Apache-2.0"
] | 30 | 2019-07-01T13:23:27.000Z | 2022-03-16T21:19:33.000Z | a2ml/tasks_queue/config.py | augerai/a2ml | 9d9ce0ac1b51cc81f1cb5ae331c4523131bc6a86 | [
"Apache-2.0"
] | 234 | 2019-07-04T13:56:15.000Z | 2021-11-04T10:12:55.000Z | a2ml/tasks_queue/config.py | augerai/a2ml | 9d9ce0ac1b51cc81f1cb5ae331c4523131bc6a86 | [
"Apache-2.0"
] | 13 | 2019-07-04T14:00:34.000Z | 2020-07-13T11:18:44.000Z | import os
class Config:
def __init__(self):
self.debug = os.environ.get('DEBUG', 'true').lower() == 'true'
self.broker_url = os.environ.get('BROKER_URL', 'amqp://localhost/vhost')
self.task_result_queue = os.environ.get('TASK_RESULT_QUEUE', 'task_result')
self.task_queue = os.enviro... | 38.666667 | 83 | 0.655172 | import os
class Config:
def __init__(self):
self.debug = os.environ.get('DEBUG', 'true').lower() == 'true'
self.broker_url = os.environ.get('BROKER_URL', 'amqp://localhost/vhost')
self.task_result_queue = os.environ.get('TASK_RESULT_QUEUE', 'task_result')
self.task_queue = os.enviro... | true | true |
1c1ceab4e8644e6de1542f5b288608e23dedbca5 | 168 | py | Python | mbench/test/__init__.py | sepmein/mBench | 5f2d7115ac8178ca0e076cfceebc75fa8d46127d | [
"BSD-3-Clause"
] | 1 | 2022-03-21T14:18:11.000Z | 2022-03-21T14:18:11.000Z | mbench/test/__init__.py | sepmein/mBench | 5f2d7115ac8178ca0e076cfceebc75fa8d46127d | [
"BSD-3-Clause"
] | 6 | 2022-03-04T11:37:52.000Z | 2022-03-31T19:13:43.000Z | mbench/test/__init__.py | sepmein/mBench | 5f2d7115ac8178ca0e076cfceebc75fa8d46127d | [
"BSD-3-Clause"
] | null | null | null | from lxml import etree
from mbench.util.xml_import import load_xml_config
root = load_xml_config("/Users/sepmein/dev/github/openmalaria/test/scenarioVecFullTest.xml") | 33.6 | 92 | 0.839286 | from lxml import etree
from mbench.util.xml_import import load_xml_config
root = load_xml_config("/Users/sepmein/dev/github/openmalaria/test/scenarioVecFullTest.xml") | true | true |
1c1ceadbf2388832bb1b4e52edcdf285fe933995 | 2,400 | py | Python | pandas_ta/volume/nvi.py | ryanrussell/pandas-ta | 720bbcf0196d363d621beeced8fba711990d075d | [
"MIT"
] | 2,298 | 2019-02-20T18:38:18.000Z | 2022-03-31T07:45:50.000Z | pandas_ta/volume/nvi.py | ryanrussell/pandas-ta | 720bbcf0196d363d621beeced8fba711990d075d | [
"MIT"
] | 451 | 2019-02-26T00:50:02.000Z | 2022-03-31T03:17:39.000Z | pandas_ta/volume/nvi.py | ryanrussell/pandas-ta | 720bbcf0196d363d621beeced8fba711990d075d | [
"MIT"
] | 579 | 2019-03-19T01:53:03.000Z | 2022-03-31T11:13:50.000Z | # -*- coding: utf-8 -*-
from pandas_ta.momentum import roc
from pandas_ta.utils import get_offset, signed_series, verify_series
def nvi(close, volume, length=None, initial=None, offset=None, **kwargs):
"""Indicator: Negative Volume Index (NVI)"""
# Validate arguments
length = int(length) if length and len... | 30.379747 | 123 | 0.687917 |
from pandas_ta.momentum import roc
from pandas_ta.utils import get_offset, signed_series, verify_series
def nvi(close, volume, length=None, initial=None, offset=None, **kwargs):
length = int(length) if length and length > 0 else 1
initial = int(initial) if initial and initial > 0 else 1000
clos... | true | true |
1c1ceb033c4ad82e9d5e5701f551c0cb43522782 | 406 | py | Python | webapp/migrations/0002_blog_content.py | anselm92/hex1e | 14c880cdf8951fa62c03f8604054c0a044397431 | [
"Apache-2.0"
] | null | null | null | webapp/migrations/0002_blog_content.py | anselm92/hex1e | 14c880cdf8951fa62c03f8604054c0a044397431 | [
"Apache-2.0"
] | 6 | 2021-03-30T14:00:12.000Z | 2022-02-04T21:32:23.000Z | webapp/migrations/0002_blog_content.py | anselm92/hex1e | 14c880cdf8951fa62c03f8604054c0a044397431 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0 on 2020-06-11 17:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('webapp', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='blog',
name='content',
field=m... | 21.368421 | 87 | 0.593596 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('webapp', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='blog',
name='content',
field=models.CharField(blank=True, default='', max_l... | true | true |
1c1cecca81d975630ff84d3577b09d04328b038e | 9,706 | py | Python | grove/tests/simon/test_simon.py | msohaibalam/grove | 8c27a5d12923d6ace57956db6a249e8d01e33f35 | [
"Apache-2.0"
] | 1 | 2020-07-15T15:40:49.000Z | 2020-07-15T15:40:49.000Z | grove/tests/simon/test_simon.py | msohaibalam/grove | 8c27a5d12923d6ace57956db6a249e8d01e33f35 | [
"Apache-2.0"
] | null | null | null | grove/tests/simon/test_simon.py | msohaibalam/grove | 8c27a5d12923d6ace57956db6a249e8d01e33f35 | [
"Apache-2.0"
] | 1 | 2021-11-27T16:20:00.000Z | 2021-11-27T16:20:00.000Z | """Test class for helper methods found simon"""
from os.path import abspath, dirname
import numpy as np
from mock import patch
from pyquil.quil import Program
from grove.simon.simon import Simon, create_1to1_bitmap, create_valid_2to1_bitmap
package_path = abspath(dirname(dirname(__file__)))
EXPECTED_SIMON_ORACLE =... | 28.973134 | 94 | 0.487946 |
from os.path import abspath, dirname
import numpy as np
from mock import patch
from pyquil.quil import Program
from grove.simon.simon import Simon, create_1to1_bitmap, create_valid_2to1_bitmap
package_path = abspath(dirname(dirname(__file__)))
EXPECTED_SIMON_ORACLE = np.load(package_path + '/simon/data/simon_test_... | true | true |
1c1ced7cadcacb6b6e1f793b720aa3873febef19 | 1,252 | py | Python | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/ossopenapi/models/UserBillCode.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/ossopenapi/models/UserBillCode.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/ossopenapi/models/UserBillCode.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | 36.823529 | 107 | 0.73722 |
class UserBillCode(object):
def __init__(self, appCode=None, serviceCode=None, storageResourceType=None, processResourceType=None):
self.appCode = appCode
self.serviceCode = serviceCode
self.storageResourceType = storageResourceType
self.processResourceType = pro... | true | true |
1c1cee2b54f3f526406746ab6d54d6da9d8f987d | 1,147 | py | Python | cvat/apps/authentication/auth_ldap.py | gitibharatibiswal/cvat-adas-team | a33c1ae38d79ed6e35a61a97b74cd2978853e4c2 | [
"Intel",
"MIT"
] | 5 | 2021-12-01T20:58:07.000Z | 2022-03-17T00:31:00.000Z | cvat/apps/authentication/auth_ldap.py | nav13n/cvat | 9bdcc7f8f2d86a763ab5f306ea049ce1432da557 | [
"Intel",
"MIT"
] | 80 | 2021-04-12T19:36:33.000Z | 2022-03-29T00:26:10.000Z | cvat/apps/authentication/auth_ldap.py | nav13n/cvat | 9bdcc7f8f2d86a763ab5f306ea049ce1432da557 | [
"Intel",
"MIT"
] | 41 | 2020-12-16T05:52:41.000Z | 2021-09-23T08:45:16.000Z |
# Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT
from django.conf import settings
from . import AUTH_ROLE
AUTH_LDAP_GROUPS = {
AUTH_ROLE.ADMIN: settings.AUTH_LDAP_ADMIN_GROUPS,
AUTH_ROLE.ANNOTATOR: settings.AUTH_LDAP_ANNOTATOR_GROUPS,
AUTH_ROLE.USER: settings.AUTH_LDAP_USER_GROUPS,... | 33.735294 | 83 | 0.709677 |
from django.conf import settings
from . import AUTH_ROLE
AUTH_LDAP_GROUPS = {
AUTH_ROLE.ADMIN: settings.AUTH_LDAP_ADMIN_GROUPS,
AUTH_ROLE.ANNOTATOR: settings.AUTH_LDAP_ANNOTATOR_GROUPS,
AUTH_ROLE.USER: settings.AUTH_LDAP_USER_GROUPS,
AUTH_ROLE.OBSERVER: settings.AUTH_LDAP_OBSERVER_GROUPS
}
def cr... | true | true |
1c1ceeab505091ca1e37ca4b76dfbb81de674220 | 9,717 | py | Python | tokenizer.py | yashbonde/gpt | 11e57a5fddd0eb20e44ebe3a661aa0b144a1730b | [
"MIT"
] | null | null | null | tokenizer.py | yashbonde/gpt | 11e57a5fddd0eb20e44ebe3a661aa0b144a1730b | [
"MIT"
] | null | null | null | tokenizer.py | yashbonde/gpt | 11e57a5fddd0eb20e44ebe3a661aa0b144a1730b | [
"MIT"
] | null | null | null | # @yashbonde x NBX Internal - 28th April 2021
# This file is based on code by the authors denoted below and has been modified from its original version.
#
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this f... | 35.988889 | 119 | 0.663682 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import sys
import json
import logging
import os
import regex as re
from io import open
import torch
from functools import lru_cache
logger = logging.getLogger(__name__)
VOCAB_NAME = 'vocab.json'
MERGES... | true | true |
1c1ceee4aafce819ab01cdc1ce076136d01b9ab7 | 517 | py | Python | project/urls.py | mikepanfilov/django-orm-watching-storage | 51d04c03bf254e95a4a4d199e75156ed0ea0fe64 | [
"MIT"
] | null | null | null | project/urls.py | mikepanfilov/django-orm-watching-storage | 51d04c03bf254e95a4a4d199e75156ed0ea0fe64 | [
"MIT"
] | null | null | null | project/urls.py | mikepanfilov/django-orm-watching-storage | 51d04c03bf254e95a4a4d199e75156ed0ea0fe64 | [
"MIT"
] | null | null | null | from datacenter.active_passcards_view import active_passcards_view
from datacenter.passcard_info_view import passcard_info_view
from datacenter.storage_information_view import storage_information_view
from django.conf.urls import url
urlpatterns = [
url(r'^$', active_passcards_view, name="active_passcards"),
... | 36.928571 | 72 | 0.775629 | from datacenter.active_passcards_view import active_passcards_view
from datacenter.passcard_info_view import passcard_info_view
from datacenter.storage_information_view import storage_information_view
from django.conf.urls import url
urlpatterns = [
url(r'^$', active_passcards_view, name="active_passcards"),
... | true | true |
1c1cef23a09319e5d24c89328b6aa831b6dd0bd7 | 1,714 | py | Python | ecommerce/core/tests/conftest.py | berrondo/ecommerce | daa0fa3c336d7e1e9816cc187f858bab7122fb1b | [
"MIT"
] | 1 | 2020-09-04T02:23:02.000Z | 2020-09-04T02:23:02.000Z | ecommerce/core/tests/conftest.py | berrondo/ecommerce | daa0fa3c336d7e1e9816cc187f858bab7122fb1b | [
"MIT"
] | null | null | null | ecommerce/core/tests/conftest.py | berrondo/ecommerce | daa0fa3c336d7e1e9816cc187f858bab7122fb1b | [
"MIT"
] | null | null | null | import pytest
from django.urls import reverse as r
from ..models import create_user, Product
@pytest.fixture(autouse=True)
def enable_db_access(db):
pass
@pytest.fixture
def a_manager():
return create_user(username='ann', password='54321', in_group='managers')
@pytest.fixture
def a_customer():
return... | 20.650602 | 94 | 0.701867 | import pytest
from django.urls import reverse as r
from ..models import create_user, Product
@pytest.fixture(autouse=True)
def enable_db_access(db):
pass
@pytest.fixture
def a_manager():
return create_user(username='ann', password='54321', in_group='managers')
@pytest.fixture
def a_customer():
return... | true | true |
1c1cef2f8ea81b1c610275a1f06b736da9179a75 | 1,271 | py | Python | Server/ChatBot/venv/Lib/site-packages/pygubu/builder/widgets/dialog.py | sozuer53/BBC | 31bb128cb1e1a19db955fd673d67cf0e92bac3a4 | [
"Apache-2.0"
] | 42 | 2018-12-12T01:00:59.000Z | 2022-03-27T07:32:29.000Z | pygubu/pygubu/builder/widgets/dialog.py | GoopyAspirin/python-rsa | 1779b35ee0abe80b44be77fe2e26c7fc26765c1c | [
"MIT"
] | 13 | 2020-11-06T13:50:45.000Z | 2022-01-25T07:17:37.000Z | pygubu/pygubu/builder/widgets/dialog.py | GoopyAspirin/python-rsa | 1779b35ee0abe80b44be77fe2e26c7fc26765c1c | [
"MIT"
] | 8 | 2020-11-14T04:30:26.000Z | 2021-01-16T17:55:19.000Z | from __future__ import unicode_literals
from pygubu.builder.builderobject import *
from pygubu.builder.tkstdwidgets import TKToplevel
from pygubu.widgets.dialog import Dialog
class DialogBO(TKToplevel):
class_ = Dialog
OPTIONS_STANDARD = TKToplevel.OPTIONS_STANDARD
OPTIONS_SPECIFIC = TKToplevel.OPTIONS_SP... | 28.886364 | 69 | 0.648308 | from __future__ import unicode_literals
from pygubu.builder.builderobject import *
from pygubu.builder.tkstdwidgets import TKToplevel
from pygubu.widgets.dialog import Dialog
class DialogBO(TKToplevel):
class_ = Dialog
OPTIONS_STANDARD = TKToplevel.OPTIONS_STANDARD
OPTIONS_SPECIFIC = TKToplevel.OPTIONS_SP... | true | true |
1c1cef88776e858f7ffbcea94a8fa28410665c86 | 2,142 | py | Python | homeassistant/components/tibber/config_flow.py | mikan-megane/core | 837220cce40890e296920d33a623adbc11bd15a6 | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/tibber/config_flow.py | mikan-megane/core | 837220cce40890e296920d33a623adbc11bd15a6 | [
"Apache-2.0"
] | 79 | 2020-07-23T07:13:37.000Z | 2022-03-22T06:02:37.000Z | homeassistant/components/tibber/config_flow.py | mikan-megane/core | 837220cce40890e296920d33a623adbc11bd15a6 | [
"Apache-2.0"
] | 6 | 2018-02-04T03:48:55.000Z | 2022-01-24T20:37:04.000Z | """Adds config flow for Tibber integration."""
import asyncio
import aiohttp
import tibber
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DOMAIN
DATA_SCHEM... | 30.169014 | 73 | 0.622782 | import asyncio
import aiohttp
import tibber
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DOMAIN
DATA_SCHEMA = vol.Schema({vol.Required(CONF_ACCESS_TOKEN)... | true | true |
1c1cf02f775a1c17068274f642c1fc0d6334fc21 | 73,317 | py | Python | test/integration/smoke/test_accounts.py | weizhouapache/cloudstack | 4742ac15f7be5d3cf6f7e328133cb8589a7578ce | [
"Apache-2.0"
] | null | null | null | test/integration/smoke/test_accounts.py | weizhouapache/cloudstack | 4742ac15f7be5d3cf6f7e328133cb8589a7578ce | [
"Apache-2.0"
] | 5 | 2018-03-15T20:07:30.000Z | 2021-04-09T16:44:30.000Z | test/integration/smoke/test_accounts.py | khos2ow/cloudstack | e107f9aa93cb1f507420e9ce90860cda42bd3433 | [
"Apache-2.0"
] | null | null | null | # 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... | 32.484271 | 126 | 0.564167 |
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.utils import (random_gen,
cleanup_resources,
validateList)
from marvin.cloudstackAPI import *
from marvin.lib.base import (Domain,
Account,
... | true | true |
1c1cf0f27cc51f32ce90c87092933402ff6229bb | 545 | py | Python | simple_timer.py | xyqyear/simple_timer | 8ffe543286047842da071de5a4a9fc886248777f | [
"MIT"
] | null | null | null | simple_timer.py | xyqyear/simple_timer | 8ffe543286047842da071de5a4a9fc886248777f | [
"MIT"
] | null | null | null | simple_timer.py | xyqyear/simple_timer | 8ffe543286047842da071de5a4a9fc886248777f | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import time
class Timer:
def __init__(self):
self.is_started = False
self.start_time = 0
self.stop_timer = 0
def start(self):
self.is_started = True
self.start_time = time.time()
def stop(self):
self.is_started = False
self.s... | 21.8 | 83 | 0.592661 |
import time
class Timer:
def __init__(self):
self.is_started = False
self.start_time = 0
self.stop_timer = 0
def start(self):
self.is_started = True
self.start_time = time.time()
def stop(self):
self.is_started = False
self.stop_timer += time.time... | true | true |
1c1cf18feec951f9f6a8181c56be94136e3ac577 | 2,828 | py | Python | benchmarks/random_tensor_benchmark.py | smoorjani/matrix-multiplication | 8d378d972f45e9f9c1f4b26457021636ad1f2d9b | [
"Apache-2.0"
] | null | null | null | benchmarks/random_tensor_benchmark.py | smoorjani/matrix-multiplication | 8d378d972f45e9f9c1f4b26457021636ad1f2d9b | [
"Apache-2.0"
] | null | null | null | benchmarks/random_tensor_benchmark.py | smoorjani/matrix-multiplication | 8d378d972f45e9f9c1f4b26457021636ad1f2d9b | [
"Apache-2.0"
] | null | null | null | import torch
import numpy as np
import time
import logging
from custom_mm import (
init_cublas,
destroy_cublas,
init_cusparse,
destroy_cusparse
)
from matmuls import (
cublas_matmul,
cusparse_matmul
)
init_cublas()
init_cusparse()
LOG = "./random_tensor_benchmark.log"
logging.basicConfig(filen... | 26.933333 | 85 | 0.641443 | import torch
import numpy as np
import time
import logging
from custom_mm import (
init_cublas,
destroy_cublas,
init_cusparse,
destroy_cusparse
)
from matmuls import (
cublas_matmul,
cusparse_matmul
)
init_cublas()
init_cusparse()
LOG = "./random_tensor_benchmark.log"
logging.basicConfig(filen... | true | true |
1c1cf34788e90fe4adbac28d430ec2fd78f74ee8 | 494 | py | Python | app/backend/backend/migrations/0003_auto_20181019_1316.py | LCTF/LCTF_2018_Platform | 258f5840b950c6ad61776026d48ef103ed3ebbf5 | [
"MIT"
] | 18 | 2018-12-17T15:33:30.000Z | 2021-08-02T19:30:09.000Z | app/backend/backend/migrations/0003_auto_20181019_1316.py | LCTF/LCTF_2018_Platform | 258f5840b950c6ad61776026d48ef103ed3ebbf5 | [
"MIT"
] | 5 | 2021-03-18T21:44:39.000Z | 2022-03-11T23:37:26.000Z | app/backend/backend/migrations/0003_auto_20181019_1316.py | LCTF/LCTF_2018_Platform | 258f5840b950c6ad61776026d48ef103ed3ebbf5 | [
"MIT"
] | 5 | 2019-03-22T07:01:14.000Z | 2021-08-02T19:30:22.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-19 13:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0002_auto_20181019_1302'),
]
operations = [
migrations.AlterFie... | 23.52381 | 89 | 0.607287 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0002_auto_20181019_1302'),
]
operations = [
migrations.AlterField(
model_name='challenges',
name='bouns',
... | true | true |
1c1cf4b7089f3c83b4d5a0714169d41aff1b4264 | 638 | py | Python | backend/cart/migrations/0013_auto_20171211_1352.py | damnee562/Shopping-cart | bd91ecf5abf28e88740ac7c608345fca26159bf9 | [
"MIT"
] | 39 | 2018-03-23T10:30:47.000Z | 2021-03-20T13:46:41.000Z | backend/cart/migrations/0013_auto_20171211_1352.py | damnee562/Shopping-cart | bd91ecf5abf28e88740ac7c608345fca26159bf9 | [
"MIT"
] | 8 | 2020-09-01T23:53:40.000Z | 2022-03-15T19:45:56.000Z | backend/cart/migrations/0013_auto_20171211_1352.py | brendeschuijmert/Django_shopping_cart | 29c12b8e91654605dc03ff6cd141e8deea63f9ef | [
"MIT"
] | 23 | 2018-01-12T11:23:03.000Z | 2021-03-08T08:24:13.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-11 13:52
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cart', '0012_auto_20171211_1345'),
]
operations = [
migrations.AddField(
... | 24.538462 | 62 | 0.595611 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cart', '0012_auto_20171211_1345'),
]
operations = [
migrations.AddField(
model_name='orders',
name='billing_method',
... | true | true |
1c1cf7bf4c73be10dc86c1da460fd2f35b02bad0 | 2,964 | py | Python | survol/sources_types/Azure/disk/disk_information.py | AugustinMascarelli/survol | 7a822900e82d1e6f016dba014af5741558b78f15 | [
"BSD-3-Clause"
] | null | null | null | survol/sources_types/Azure/disk/disk_information.py | AugustinMascarelli/survol | 7a822900e82d1e6f016dba014af5741558b78f15 | [
"BSD-3-Clause"
] | null | null | null | survol/sources_types/Azure/disk/disk_information.py | AugustinMascarelli/survol | 7a822900e82d1e6f016dba014af5741558b78f15 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Information about an Azure disk
"""
import sys
import socket
import lib_util
import lib_common
from lib_properties import pc
import lib_credentials
from azure import *
from azure.servicemanagement import *
from sources_types import Azure
from sources_types.Azure import subscription
from sou... | 38 | 118 | 0.773279 |
import sys
import socket
import lib_util
import lib_common
from lib_properties import pc
import lib_credentials
from azure import *
from azure.servicemanagement import *
from sources_types import Azure
from sources_types.Azure import subscription
from sources_types.Azure import service
from sources_types.Azure impo... | true | true |
1c1cf7f552c70e4c40fcafd76bc89bc3b5fe06ba | 5,385 | py | Python | tensorflow_self_check.py | pwentrys/tensorflow_tests | b8d897bc1ca02c9f35139cc8090ee3814e349716 | [
"MIT"
] | null | null | null | tensorflow_self_check.py | pwentrys/tensorflow_tests | b8d897bc1ca02c9f35139cc8090ee3814e349716 | [
"MIT"
] | null | null | null | tensorflow_self_check.py | pwentrys/tensorflow_tests | b8d897bc1ca02c9f35139cc8090ee3814e349716 | [
"MIT"
] | null | null | null | # Copyright 2015 The TensorFlow 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 applica... | 38.191489 | 86 | 0.687094 |
import ctypes
import imp
import sys
def main():
try:
import tensorflow as tf
print("TensorFlow successfully installed.")
if tf.test.is_built_with_cuda():
print("The installed version of TensorFlow includes GPU support.")
else:
print("The insta... | true | true |
1c1cf851c776bfc027d06ce88b26da2ea6bd362f | 328 | py | Python | driver.py | iandtek/viddyoze-bot | 541d9536fa34850f9fed0335c64964e7ef29eb18 | [
"MIT"
] | null | null | null | driver.py | iandtek/viddyoze-bot | 541d9536fa34850f9fed0335c64964e7ef29eb18 | [
"MIT"
] | null | null | null | driver.py | iandtek/viddyoze-bot | 541d9536fa34850f9fed0335c64964e7ef29eb18 | [
"MIT"
] | null | null | null | from selenium import webdriver
import os
chrome_options = webdriver.ChromeOptions()
prefs = {'download.default_directory': os.getcwd() + '/' + 'renders'}
chrome_options.add_experimental_option('prefs', prefs)
driver = webdriver.Chrome(chrome_options=chrome_options)
URL = 'https://app.viddyoze.com/templates'
driver.g... | 27.333333 | 69 | 0.777439 | from selenium import webdriver
import os
chrome_options = webdriver.ChromeOptions()
prefs = {'download.default_directory': os.getcwd() + '/' + 'renders'}
chrome_options.add_experimental_option('prefs', prefs)
driver = webdriver.Chrome(chrome_options=chrome_options)
URL = 'https://app.viddyoze.com/templates'
driver.g... | true | true |
1c1cf9da105efe4e6ec378073c48ecdc2a36487d | 14,128 | py | Python | configs/mvxnet/parallel/hybrid/dv_parallel_mvx_pgd_adamw_kitti-3d-3class_loss2_pre_choi_aux4_ifatv2_iou.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | configs/mvxnet/parallel/hybrid/dv_parallel_mvx_pgd_adamw_kitti-3d-3class_loss2_pre_choi_aux4_ifatv2_iou.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | configs/mvxnet/parallel/hybrid/dv_parallel_mvx_pgd_adamw_kitti-3d-3class_loss2_pre_choi_aux4_ifatv2_iou.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../../_base_/schedules/cosine.py', '../../../_base_/default_runtime.py'
]
# model settings
voxel_size = [0.05, 0.05, 0.1]
point_cloud_range = [0, -40, -3, 70.4, 40, 1]
model = dict(
type='ParallelMVXMono3D',
loss_pts_w = 1.,
loss_img_w = 0.125,
use_li_fusion_layer=True,
pos_li_f... | 33.009346 | 79 | 0.56703 | _base_ = [
'../../../_base_/schedules/cosine.py', '../../../_base_/default_runtime.py'
]
voxel_size = [0.05, 0.05, 0.1]
point_cloud_range = [0, -40, -3, 70.4, 40, 1]
model = dict(
type='ParallelMVXMono3D',
loss_pts_w = 1.,
loss_img_w = 0.125,
use_li_fusion_layer=True,
pos_li_fusion_layer='cho... | true | true |
1c1cfa03b074e194c558f9a559466b03d4439fc9 | 655 | py | Python | database/core/migrations/0003_auto_20210211_0226.py | gembancud/Cheating-Detection | f9f9d2674f3ef6349526a957783ecc58e4d05d0a | [
"MIT"
] | 3 | 2021-03-29T05:24:12.000Z | 2022-03-14T08:46:10.000Z | database/core/migrations/0003_auto_20210211_0226.py | gembancud/Cheating-Detection | f9f9d2674f3ef6349526a957783ecc58e4d05d0a | [
"MIT"
] | 2 | 2021-03-29T06:48:47.000Z | 2021-05-24T07:50:20.000Z | database/core/migrations/0003_auto_20210211_0226.py | gembancud/Cheating-Detection | f9f9d2674f3ef6349526a957783ecc58e4d05d0a | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-02-10 18:26
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20210116_2022'),
]
operations = [
migrations.AddField(
model_name='snapshot',
... | 25.192308 | 93 | 0.610687 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20210116_2022'),
]
operations = [
migrations.AddField(
model_name='snapshot',
name='date_created',
field... | true | true |
1c1cfabf00ab976d230fc3a02839b53d7d54b6de | 2,666 | py | Python | usaspending_api/common/tests/unit/test_helpers.py | bminahankcfrb/usaspending-api | 1fb5c4c261edf91ab2930aea7928ca24dfa49123 | [
"CC0-1.0"
] | 1 | 2020-06-15T19:59:52.000Z | 2020-06-15T19:59:52.000Z | usaspending_api/common/tests/unit/test_helpers.py | bminahankcfrb/usaspending-api | 1fb5c4c261edf91ab2930aea7928ca24dfa49123 | [
"CC0-1.0"
] | null | null | null | usaspending_api/common/tests/unit/test_helpers.py | bminahankcfrb/usaspending-api | 1fb5c4c261edf91ab2930aea7928ca24dfa49123 | [
"CC0-1.0"
] | null | null | null | import pytest
from datetime import datetime
from model_mommy import mommy
from usaspending_api.common.helpers.generic_helper import check_valid_toptier_agency
from usaspending_api.common.helpers.fiscal_year_helpers import generate_fiscal_period, generate_fiscal_year
@pytest.mark.django_db
def test_check_valid_topti... | 28.063158 | 107 | 0.745311 | import pytest
from datetime import datetime
from model_mommy import mommy
from usaspending_api.common.helpers.generic_helper import check_valid_toptier_agency
from usaspending_api.common.helpers.fiscal_year_helpers import generate_fiscal_period, generate_fiscal_year
@pytest.mark.django_db
def test_check_valid_topti... | true | true |
1c1cfae9554984a9c484d70580e172e45f034354 | 15,258 | py | Python | tests/test_10_exceptions.py | trustcrypto/PGPy | b77f8303827368c50b25535a64a831e611ca0cc2 | [
"BSD-3-Clause"
] | 5 | 2017-03-28T15:19:30.000Z | 2019-09-09T20:23:43.000Z | tests/test_10_exceptions.py | trustcrypto/PGPy | b77f8303827368c50b25535a64a831e611ca0cc2 | [
"BSD-3-Clause"
] | null | null | null | tests/test_10_exceptions.py | trustcrypto/PGPy | b77f8303827368c50b25535a64a831e611ca0cc2 | [
"BSD-3-Clause"
] | 1 | 2021-01-12T05:45:57.000Z | 2021-01-12T05:45:57.000Z | """ explicitly test error scenarios
"""
import pytest
import glob
from pgpy import PGPKey
from pgpy import PGPKeyring
from pgpy import PGPMessage
from pgpy import PGPSignature
from pgpy import PGPUID
from pgpy.constants import EllipticCurveOID
from pgpy.constants import HashAlgorithm
from pgpy.constants import KeyFlag... | 35.816901 | 156 | 0.673942 | import pytest
import glob
from pgpy import PGPKey
from pgpy import PGPKeyring
from pgpy import PGPMessage
from pgpy import PGPSignature
from pgpy import PGPUID
from pgpy.constants import EllipticCurveOID
from pgpy.constants import HashAlgorithm
from pgpy.constants import KeyFlags
from pgpy.constants import PubKeyAlgor... | true | true |
1c1cfafa52617f16f18853b1bafe67b9f5674c53 | 1,778 | py | Python | plugins/digitalocean/komand_digitalocean/actions/get_user_information/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/digitalocean/komand_digitalocean/actions/get_user_information/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/digitalocean/komand_digitalocean/actions/get_user_information/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Gets information about the account, such as email, droplet limit, etc"
class Input:
pass
class Output:
ACCOUNT = "account"
class GetUserInformationInput(komand.Input):
schema = json.loads("""
... | 20.436782 | 89 | 0.482002 |
import komand
import json
class Component:
DESCRIPTION = "Gets information about the account, such as email, droplet limit, etc"
class Input:
pass
class Output:
ACCOUNT = "account"
class GetUserInformationInput(komand.Input):
schema = json.loads("""
{}
""")
def __init__(self):
... | true | true |
1c1cfd2b212802a94d31c11622a46aadb8339eb1 | 3,651 | py | Python | atlaselectrophysiology/rendering.py | mschart/iblapps | f7e36ddc102cb003d81e0c75d7871bfc666d7f32 | [
"MIT"
] | null | null | null | atlaselectrophysiology/rendering.py | mschart/iblapps | f7e36ddc102cb003d81e0c75d7871bfc666d7f32 | [
"MIT"
] | null | null | null | atlaselectrophysiology/rendering.py | mschart/iblapps | f7e36ddc102cb003d81e0c75d7871bfc666d7f32 | [
"MIT"
] | null | null | null | from pathlib import Path
import numpy as np
import cv2
import vtk
from matplotlib import pyplot as plt # noqa
import mayavi.mlab as mlab
def add_mesh(fig, obj_file, color=(1., 1., 1.), opacity=0.4):
"""
Adds a mesh object from an *.obj file to the mayavi figure
:param fig: mayavi figure
:param obj_f... | 36.51 | 140 | 0.66968 | from pathlib import Path
import numpy as np
import cv2
import vtk
from matplotlib import pyplot as plt
import mayavi.mlab as mlab
def add_mesh(fig, obj_file, color=(1., 1., 1.), opacity=0.4):
reader = vtk.vtkOBJReader()
reader.SetFileName(str(obj_file))
reader.Update()
mapper = vtk.vtkPolyDataMappe... | true | true |
1c1cfe2091fe8c4b9c7e87fec47f9362166844ee | 226 | py | Python | sse_wrapper/utils.py | gfronza/django-sse-wrapper | ad0056b0a0589061cc47dfe0d938b733cb3d1f75 | [
"BSD-3-Clause"
] | 13 | 2015-10-18T21:24:14.000Z | 2021-09-27T10:50:10.000Z | sse_wrapper/utils.py | gfronza/django-sse-wrapper | ad0056b0a0589061cc47dfe0d938b733cb3d1f75 | [
"BSD-3-Clause"
] | 5 | 2015-05-08T21:30:03.000Z | 2020-06-05T17:27:09.000Z | sse_wrapper/utils.py | gfronza/django-sse-wrapper | ad0056b0a0589061cc47dfe0d938b733cb3d1f75 | [
"BSD-3-Clause"
] | 6 | 2015-03-13T16:12:53.000Z | 2018-08-07T09:52:42.000Z | # -*- coding: utf-8 -*-
import importlib
def class_from_str(class_str):
module_name, class_name = class_str.rsplit(".", 1)
somemodule = importlib.import_module(module_name)
return getattr(somemodule, class_name)
| 25.111111 | 54 | 0.725664 |
import importlib
def class_from_str(class_str):
module_name, class_name = class_str.rsplit(".", 1)
somemodule = importlib.import_module(module_name)
return getattr(somemodule, class_name)
| true | true |
1c1cfe2d0c543ab4859f100c81aa3acdef626fdc | 15,205 | py | Python | gem/embedding/vae.py | vinnamkim/GEM-Benchmark | 8420c565531098b5b36abec340f1c5e330c4dbcc | [
"BSD-3-Clause"
] | null | null | null | gem/embedding/vae.py | vinnamkim/GEM-Benchmark | 8420c565531098b5b36abec340f1c5e330c4dbcc | [
"BSD-3-Clause"
] | null | null | null | gem/embedding/vae.py | vinnamkim/GEM-Benchmark | 8420c565531098b5b36abec340f1c5e330c4dbcc | [
"BSD-3-Clause"
] | null | null | null | from time import time
from theano.printing import debugprint as dbprint, pprint
from keras import callbacks
from keras import backend as KBack
from keras.optimizers import SGD, Adam
import keras.regularizers as Reg
from keras.models import Model, model_from_json
from keras.layers import Input, Dense, Lambda, mer... | 40.546667 | 93 | 0.550674 | from time import time
from theano.printing import debugprint as dbprint, pprint
from keras import callbacks
from keras import backend as KBack
from keras.optimizers import SGD, Adam
import keras.regularizers as Reg
from keras.models import Model, model_from_json
from keras.layers import Input, Dense, Lambda, mer... | false | true |
1c1cff08d4ebeb1892c9d02682538affd7b37a6c | 175 | py | Python | main/urls.py | iftah12/iiftaah | 1d2f37fc6ae549e0c0fa2baf0cb72a52fca78065 | [
"Unlicense"
] | null | null | null | main/urls.py | iftah12/iiftaah | 1d2f37fc6ae549e0c0fa2baf0cb72a52fca78065 | [
"Unlicense"
] | null | null | null | main/urls.py | iftah12/iiftaah | 1d2f37fc6ae549e0c0fa2baf0cb72a52fca78065 | [
"Unlicense"
] | null | null | null | from django.urls import path
from . import views
app_name = 'main'
urlpatterns = [
path('create/', views.create, name='create'),
path('', views.home, name='home'),
] | 19.444444 | 49 | 0.651429 | from django.urls import path
from . import views
app_name = 'main'
urlpatterns = [
path('create/', views.create, name='create'),
path('', views.home, name='home'),
] | true | true |
1c1cffcb8efd999726c69c753118a550872959a2 | 417 | py | Python | deafwave/util/pip_import.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | deafwave/util/pip_import.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | deafwave/util/pip_import.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | "Import a package and install it with PIP if it doesn't exist."
import subprocess
import sys
def pip_import(module, pypi_name=None):
"""
Return None if we can't import or install it.
"""
try:
return __import__(module)
except ImportError:
pass
subprocess.call([sys.executable, ... | 21.947368 | 63 | 0.630695 |
import subprocess
import sys
def pip_import(module, pypi_name=None):
try:
return __import__(module)
except ImportError:
pass
subprocess.call([sys.executable, "-m", "pip",
"install", pypi_name or module])
return __import__(module)
| true | true |
1c1d002816d26a2c9d843cec6a439f366265db96 | 158 | py | Python | contrib/wallettools/walletunlock.py | arses-project/arses | 1dbaaecb67aa2ff9bfebe8e476c5477b63b1a71c | [
"MIT"
] | 1 | 2019-04-04T08:39:33.000Z | 2019-04-04T08:39:33.000Z | contrib/wallettools/walletunlock.py | arses-project/arses | 1dbaaecb67aa2ff9bfebe8e476c5477b63b1a71c | [
"MIT"
] | null | null | null | contrib/wallettools/walletunlock.py | arses-project/arses | 1dbaaecb67aa2ff9bfebe8e476c5477b63b1a71c | [
"MIT"
] | null | null | null | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:7474")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
| 31.6 | 46 | 0.765823 | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:7474")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
| true | true |
1c1d00cf17d040a33d321b2711db0cd2fd169359 | 889 | py | Python | backend/app/__init__.py | peterg17/bookmarkd | b01cc541d0a3ef391399754ec73e17fe92c36b75 | [
"MIT"
] | null | null | null | backend/app/__init__.py | peterg17/bookmarkd | b01cc541d0a3ef391399754ec73e17fe92c36b75 | [
"MIT"
] | null | null | null | backend/app/__init__.py | peterg17/bookmarkd | b01cc541d0a3ef391399754ec73e17fe92c36b75 | [
"MIT"
] | null | null | null | import os
from flask import Flask, Blueprint, jsonify, request
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS
import logging
POSTGRES = {
"user": "postgres",
"pw": "",
"db": "db",
"host": "localhost",
"port": "5432",
}
SQLALCHEMY_DATABASE_URI = (
"postgresql://%(user)s:\
%... | 20.204545 | 69 | 0.67604 | import os
from flask import Flask, Blueprint, jsonify, request
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS
import logging
POSTGRES = {
"user": "postgres",
"pw": "",
"db": "db",
"host": "localhost",
"port": "5432",
}
SQLALCHEMY_DATABASE_URI = (
"postgresql://%(user)s:\
%... | true | true |
1c1d023fb08ffc5820053950b81c6438da2b8c04 | 3,701 | py | Python | src/common/EventManager.py | SwatKat1977/secureshed | 9b82f1358bd710dfe4b8c3e49ff11ecb4c77250e | [
"Apache-2.0"
] | null | null | null | src/common/EventManager.py | SwatKat1977/secureshed | 9b82f1358bd710dfe4b8c3e49ff11ecb4c77250e | [
"Apache-2.0"
] | 2 | 2019-12-03T23:26:25.000Z | 2020-09-16T20:17:25.000Z | src/common/EventManager.py | SwatKat1977/secureshed | 9b82f1358bd710dfe4b8c3e49ff11ecb4c77250e | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2019-2020 Secure Shed Project Dev Team
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 32.464912 | 79 | 0.677655 | import enum
usCode(enum.Enum):
Success = 0
InvalidEventID = 1
EventManagerDisabled = 2
:
self._enabled = True
self._eventHandlers = {}
self._events = []
def QueueEvent(self, event):
if not self._enabled:
return EventManagerStatusCode.E... | true | true |
1c1d02efaa8fe90366f4ac61c61a67b1c6f02959 | 8,129 | py | Python | tests/integrations/test_feature_extraction.py | scottcha/tsfresh | b3395c12d7e25494bdc297a31f6d1136e76c477e | [
"MIT"
] | 1 | 2021-03-16T15:08:04.000Z | 2021-03-16T15:08:04.000Z | tests/integrations/test_feature_extraction.py | scottcha/tsfresh | b3395c12d7e25494bdc297a31f6d1136e76c477e | [
"MIT"
] | null | null | null | tests/integrations/test_feature_extraction.py | scottcha/tsfresh | b3395c12d7e25494bdc297a31f6d1136e76c477e | [
"MIT"
] | null | null | null | # This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)
# Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016
from unittest import TestCase
import dask.dataframe as dd
import pandas as pd
from tsfresh.examples.driftbif_simulation import load_driftbif
fro... | 50.80625 | 120 | 0.57953 |
from unittest import TestCase
import dask.dataframe as dd
import pandas as pd
from tsfresh.examples.driftbif_simulation import load_driftbif
from tsfresh import extract_relevant_features, extract_features
from tsfresh.feature_extraction import MinimalFCParameters
class FeatureExtractionTestCase(TestCase):
de... | true | true |
1c1d036b310ef42358d8f2f9d58b4ad7c43a1cce | 3,896 | py | Python | monchis/venta/models.py | Brandon1625/constmonchis | 0b744cf16b854b8945591b4155d32e90a3059b5b | [
"bzip2-1.0.6"
] | null | null | null | monchis/venta/models.py | Brandon1625/constmonchis | 0b744cf16b854b8945591b4155d32e90a3059b5b | [
"bzip2-1.0.6"
] | null | null | null | monchis/venta/models.py | Brandon1625/constmonchis | 0b744cf16b854b8945591b4155d32e90a3059b5b | [
"bzip2-1.0.6"
] | null | null | null | from django.db import models
from producto.models import Producto
from cliente.models import Cliente
from comun.models import Tipopago
from trabajador.models import Trabajador
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from django.db.models import Sum, F
from django... | 39.755102 | 136 | 0.686345 | from django.db import models
from producto.models import Producto
from cliente.models import Cliente
from comun.models import Tipopago
from trabajador.models import Trabajador
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from django.db.models import Sum, F
from django... | true | true |
1c1d048ebe9c84cafaa6b5943aaffbd21a16436e | 17,675 | py | Python | hubblestack/files/hubblestack_nova/oval_scanner.py | buddwm/hubble | b384ee48556ca144ae6f09dd0b45db29288e5293 | [
"Apache-2.0"
] | null | null | null | hubblestack/files/hubblestack_nova/oval_scanner.py | buddwm/hubble | b384ee48556ca144ae6f09dd0b45db29288e5293 | [
"Apache-2.0"
] | null | null | null | hubblestack/files/hubblestack_nova/oval_scanner.py | buddwm/hubble | b384ee48556ca144ae6f09dd0b45db29288e5293 | [
"Apache-2.0"
] | null | null | null | """
This is a Hubble Nova CVE scanner that uses an OVAL source file.
Written by Wes Miser
Contributions by Michael Robinson and Proofpoint, Inc.
To use this scanner, a yaml file must exist within the
hubblestack_nova_profiles directory, preferably within the cve folder. The
contents of the file should be as follows ... | 41.200466 | 151 | 0.624272 |
import xml.etree.ElementTree as ET
import json
import requests
import logging
import hubblestack.utils.platform
def __virtual__():
return not hubblestack.utils.platform.is_windows()
def audit(data_list, tags, labels, debug=False, **kwargs):
ret = {'Success': [], 'Failure': []}
for profile, data in da... | true | true |
1c1d04ac88466665fcb2f1355e0854b177d97a49 | 3,866 | py | Python | store/models.py | vollov/ecomstore | ba9d7e6d74b29de2e3e9411a481248afdc172a40 | [
"MIT"
] | null | null | null | store/models.py | vollov/ecomstore | ba9d7e6d74b29de2e3e9411a481248afdc172a40 | [
"MIT"
] | null | null | null | store/models.py | vollov/ecomstore | ba9d7e6d74b29de2e3e9411a481248afdc172a40 | [
"MIT"
] | null | null | null | from django.db import models
import uuid
class Store(models.Model):
id = models.CharField(max_length=64, primary_key=True, verbose_name=u"Activation key",
default=uuid.uuid4)
name = models.CharField(max_length=60, unique=True, null=True)
code = models.CharField(max_length=10, unique=True, ... | 42.021739 | 108 | 0.662959 | from django.db import models
import uuid
class Store(models.Model):
id = models.CharField(max_length=64, primary_key=True, verbose_name=u"Activation key",
default=uuid.uuid4)
name = models.CharField(max_length=60, unique=True, null=True)
code = models.CharField(max_length=10, unique=True, ... | true | true |
1c1d053356c7253aa9ddc57877c3aea23ae98d82 | 3,205 | py | Python | schooloam/school.py | ChaiyapatOam/schooloam | 9e560aaacc2cd185134973d8e67b4d981bdcd405 | [
"MIT"
] | null | null | null | schooloam/school.py | ChaiyapatOam/schooloam | 9e560aaacc2cd185134973d8e67b4d981bdcd405 | [
"MIT"
] | null | null | null | schooloam/school.py | ChaiyapatOam/schooloam | 9e560aaacc2cd185134973d8e67b4d981bdcd405 | [
"MIT"
] | null | null | null | #school
class Student:
def __init__(self,name,lastname):
self.name = name
self.lastname = lastname
self.exp = 0 # EXP
self.lesson = 0
self.vehicle = 'Bus'
@property
def fullname(self):
return '{} {}'.format(self.name,self.lastname)
def Codi... | 27.161017 | 89 | 0.564743 |
class Student:
def __init__(self,name,lastname):
self.name = name
self.lastname = lastname
self.exp = 0
self.lesson = 0
self.vehicle = 'Bus'
@property
def fullname(self):
return '{} {}'.format(self.name,self.lastname)
def Coding(self):
... | true | true |
1c1d05fc2e344a01134814de74fd8336c48d87d7 | 3,268 | py | Python | python/scrapy/collection/settings.py | le3t/ko-repo | 50eb0b4cadb9db9bf608a9e5d36376f38ff5cce5 | [
"Apache-2.0"
] | 4 | 2019-10-26T01:25:30.000Z | 2020-01-12T08:10:25.000Z | python/scrapy/collection/settings.py | Artister/tutorials-java | 50eb0b4cadb9db9bf608a9e5d36376f38ff5cce5 | [
"Apache-2.0"
] | 3 | 2019-08-26T13:41:57.000Z | 2019-08-26T13:44:21.000Z | python/scrapy/collection/settings.py | Artister/tutorials-java | 50eb0b4cadb9db9bf608a9e5d36376f38ff5cce5 | [
"Apache-2.0"
] | 1 | 2019-12-30T12:27:38.000Z | 2019-12-30T12:27:38.000Z | # -*- coding: utf-8 -*-
# Scrapy settings for data_collection project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://doc.scrapy.org/en/latest/topics/settings.html
# https://doc.scrapy.org/en/late... | 32.039216 | 102 | 0.774786 |
BOT_NAME = 'collection'
SPIDER_MODULES = ['collection.spiders']
NEWSPIDER_MODULE = 'collection.spiders'
ROBOTSTXT_OBEY = False
CONCURRENT_REQUESTS = 16
| true | true |
1c1d066358a7e80c76a9164f4cafbfd23cdc3b9f | 16,658 | py | Python | venv/lib/python3.6/site-packages/twilio/rest/authy/v1/service/entity/factor/challenge.py | fernandoleira/stocktext | f755f83ffdaee3b179e21de955854354aced9134 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/twilio/rest/authy/v1/service/entity/factor/challenge.py | fernandoleira/stocktext | f755f83ffdaee3b179e21de955854354aced9134 | [
"MIT"
] | 11 | 2019-12-26T17:21:03.000Z | 2022-03-21T22:17:07.000Z | venv/Lib/python3.6/site-packages/twilio/rest/authy/v1/service/entity/factor/challenge.py | chinmaya-dev/ttbdonation | 1ea4cb2c279db86465040b68f1fa48dbb5f7e17c | [
"MIT"
] | null | null | null | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import ... | 31.549242 | 128 | 0.613879 |
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class Challeng... | true | true |
1c1d066f88641664c817917bf448f0062228e7ef | 7,644 | py | Python | src/interactive/azext_interactive/tests/latest/test_query_injection.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 2 | 2021-06-05T17:51:26.000Z | 2021-11-17T11:17:56.000Z | src/interactive/azext_interactive/tests/latest/test_query_injection.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 3 | 2020-05-27T20:16:26.000Z | 2020-07-23T19:46:49.000Z | src/interactive/azext_interactive/tests/latest/test_query_injection.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 5 | 2020-09-08T22:46:48.000Z | 2020-11-08T14:54:35.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 35.887324 | 111 | 0.534929 |
import unittest
import six
import os
import json
import mock
from azext_interactive.azclishell.util import parse_quotes
from azext_interactive.azclishell.gather_commands import GatherCommands
def pass_gather(*_):
pass
class MockValues(object):
def __init__(self):
self.result = None
@mock.pat... | true | true |
1c1d073d4e79253b9c4a8aeb7fff4bb5373a6a04 | 403 | py | Python | officialWebsite/team/models.py | animesh-007/officialWebsite | 07fd094f61fa88b5f8cba77bb71662d048b48936 | [
"MIT"
] | null | null | null | officialWebsite/team/models.py | animesh-007/officialWebsite | 07fd094f61fa88b5f8cba77bb71662d048b48936 | [
"MIT"
] | null | null | null | officialWebsite/team/models.py | animesh-007/officialWebsite | 07fd094f61fa88b5f8cba77bb71662d048b48936 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from officialWebsite.members.models import Member
class Team(models.Model):
name = models.CharField(max_length=255)
heads = models.ManyToManyField(Member, related_name="heads", blank=True)
members = models.ManyToManyField(Member, re... | 28.785714 | 80 | 0.756824 | from django.db import models
from django.contrib.auth.models import User
from officialWebsite.members.models import Member
class Team(models.Model):
name = models.CharField(max_length=255)
heads = models.ManyToManyField(Member, related_name="heads", blank=True)
members = models.ManyToManyField(Member, re... | true | true |
1c1d07b48c57a40b3d2c18ddfaec6f2d88d353cb | 8,015 | py | Python | train.py | jaisakthism/u-net | daf600930d6637f65beafc8f914e186bfc418316 | [
"MIT"
] | 471 | 2016-07-15T06:02:31.000Z | 2022-03-29T08:08:31.000Z | train.py | jaisakthism/u-net | daf600930d6637f65beafc8f914e186bfc418316 | [
"MIT"
] | 19 | 2016-10-26T22:55:22.000Z | 2019-03-10T13:02:11.000Z | train.py | jaisakthism/u-net | daf600930d6637f65beafc8f914e186bfc418316 | [
"MIT"
] | 186 | 2016-08-07T17:21:39.000Z | 2022-02-10T23:26:11.000Z | from __future__ import print_function
import cv2
import numpy as np
from keras.models import Model
from keras.layers import Input, merge, Convolution2D, MaxPooling2D, UpSampling2D, Dropout
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras import backend as ... | 38.719807 | 152 | 0.673612 | from __future__ import print_function
import cv2
import numpy as np
from keras.models import Model
from keras.layers import Input, merge, Convolution2D, MaxPooling2D, UpSampling2D, Dropout
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras import backend as ... | true | true |
1c1d08c991d6cea664a4061bb5f884b153bc8f37 | 8,734 | py | Python | mmdet/core/bbox/assigners/region_assigner.py | DongshuoYin/garbage_dump_detection | 1087f2cd35f781c5d973db5a59ecf8eb3bfa2537 | [
"Apache-2.0"
] | null | null | null | mmdet/core/bbox/assigners/region_assigner.py | DongshuoYin/garbage_dump_detection | 1087f2cd35f781c5d973db5a59ecf8eb3bfa2537 | [
"Apache-2.0"
] | null | null | null | mmdet/core/bbox/assigners/region_assigner.py | DongshuoYin/garbage_dump_detection | 1087f2cd35f781c5d973db5a59ecf8eb3bfa2537 | [
"Apache-2.0"
] | null | null | null | import torch
from mmdet.core import anchor_inside_flags
from ..builder import BBOX_ASSIGNERS
from .assign_result import AssignResult
from .base_assigner import BaseAssigner
def calc_region(bbox, ratio, stride, featmap_size=None):
"""Calculate region of the box defined by the ratio, the ratio is from the
cent... | 42.604878 | 79 | 0.587589 | import torch
from mmdet.core import anchor_inside_flags
from ..builder import BBOX_ASSIGNERS
from .assign_result import AssignResult
from .base_assigner import BaseAssigner
def calc_region(bbox, ratio, stride, featmap_size=None):
f_bbox = bbox / stride
x1 = torch.round((1 - ratio) * f_bbox[0] + ratio * ... | true | true |
1c1d09a9840df9b06f5ac586b3304908ff88d973 | 482 | py | Python | config/s3_storages.py | RamParameswaran/findram.dev | ed44c0ef9287906117ba9ee48e447cd8d6a62a7f | [
"MIT"
] | 1 | 2020-11-12T00:41:16.000Z | 2020-11-12T00:41:16.000Z | config/s3_storages.py | RamParameswaran/findram.dev | ed44c0ef9287906117ba9ee48e447cd8d6a62a7f | [
"MIT"
] | null | null | null | config/s3_storages.py | RamParameswaran/findram.dev | ed44c0ef9287906117ba9ee48e447cd8d6a62a7f | [
"MIT"
] | null | null | null | from config.settings.base import env
from storages.backends.s3boto3 import S3Boto3Storage
class MediaStorage(S3Boto3Storage):
bucket_name = env.str("S3_RESOURCES_BUCKET_NAME", default=None)
custom_domain = env.str("AWS_S3_CUSTOM_DOMAIN", default=None)
location = "media"
class StaticStorage(S3Boto3Storag... | 32.133333 | 67 | 0.771784 | from config.settings.base import env
from storages.backends.s3boto3 import S3Boto3Storage
class MediaStorage(S3Boto3Storage):
bucket_name = env.str("S3_RESOURCES_BUCKET_NAME", default=None)
custom_domain = env.str("AWS_S3_CUSTOM_DOMAIN", default=None)
location = "media"
class StaticStorage(S3Boto3Storag... | true | true |
1c1d0a34cde48cf2a3bcc43489d2d56914d7a355 | 42,625 | py | Python | openmdao/solvers/nonlinear/tests/test_newton.py | gjkennedy/OpenMDAO | 06897b584403cce34bc106dd2840aa07eea69e96 | [
"Apache-2.0"
] | null | null | null | openmdao/solvers/nonlinear/tests/test_newton.py | gjkennedy/OpenMDAO | 06897b584403cce34bc106dd2840aa07eea69e96 | [
"Apache-2.0"
] | null | null | null | openmdao/solvers/nonlinear/tests/test_newton.py | gjkennedy/OpenMDAO | 06897b584403cce34bc106dd2840aa07eea69e96 | [
"Apache-2.0"
] | null | null | null | """Test the Newton nonlinear solver. """
import unittest
import warnings
import numpy as np
import openmdao.api as om
from openmdao.core.tests.test_discrete import InternalDiscreteGroup
from openmdao.test_suite.components.double_sellar import DoubleSellar, DoubleSellarImplicit, \
SubSellar
from openmdao.test_s... | 37.82165 | 115 | 0.629654 |
import unittest
import warnings
import numpy as np
import openmdao.api as om
from openmdao.core.tests.test_discrete import InternalDiscreteGroup
from openmdao.test_suite.components.double_sellar import DoubleSellar, DoubleSellarImplicit, \
SubSellar
from openmdao.test_suite.components.implicit_newton_linesearc... | true | true |
1c1d0b2f6e48bd05e24b2191aee0213dadefa29a | 1,529 | py | Python | src/ggrc_risks/migrations/versions/20140921081059_5ada65dc60b3_add_threat_actors_table.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | null | null | null | src/ggrc_risks/migrations/versions/20140921081059_5ada65dc60b3_add_threat_actors_table.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | 12 | 2015-01-08T14:50:19.000Z | 2017-11-29T19:37:53.000Z | src/ggrc_risks/migrations/versions/20140921081059_5ada65dc60b3_add_threat_actors_table.py | mikecb/ggrc-core | 1cda560cb0920021416e07740c6cca1acba56268 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2015-01-08T13:25:09.000Z | 2015-01-08T13:25:09.000Z | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
"""Add threat_actors table
Revision ID: 5ada65dc60b3
Revises: 5aa58c3b1867
Crea... | 33.977778 | 78 | 0.70569 |
revision = '5ada65dc60b3'
down_revision = '5aa58c3b1867'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('threat_actors',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('modified_by_id', sa.Integer(), nullable=True),
sa.Column('created_at', sa.DateTime(), ... | true | true |
1c1d0c1685448a2870d77006d8ccbd08488cea78 | 6,756 | py | Python | exp/run.py | dataiku-research/paper_ial_2021 | f860b6eb2d8471bc23e44d282e50c4deaf0813d9 | [
"Apache-2.0"
] | 1 | 2021-09-06T11:06:07.000Z | 2021-09-06T11:06:07.000Z | exp/run.py | dataiku-research/paper_ial_2021 | f860b6eb2d8471bc23e44d282e50c4deaf0813d9 | [
"Apache-2.0"
] | null | null | null | exp/run.py | dataiku-research/paper_ial_2021 | f860b6eb2d8471bc23e44d282e50c4deaf0813d9 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import itertools
from copy import deepcopy
from pathlib import Path
import importlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="1"
from sklearn.model_selection import train_test_split
f... | 38.386364 | 178 | 0.682356 | import os
import sys
import itertools
from copy import deepcopy
from pathlib import Path
import importlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="1"
from sklearn.model_selection import train_test_split
f... | true | true |
1c1d0cbb02e57516532228fa5a544068e5d2785a | 3,374 | py | Python | test/functional/test_framework/coverage.py | decenomy/OWO | 648a24239ac1abd490c0d132addcb59b30f239a5 | [
"MIT"
] | 1 | 2020-05-31T10:06:19.000Z | 2020-05-31T10:06:19.000Z | test/functional/test_framework/coverage.py | decenomy/OWO | 648a24239ac1abd490c0d132addcb59b30f239a5 | [
"MIT"
] | null | null | null | test/functional/test_framework/coverage.py | decenomy/OWO | 648a24239ac1abd490c0d132addcb59b30f239a5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Utilities for doing coverage analysis on the RPC interface.
Provides a way to track which RPC commands... | 30.672727 | 87 | 0.661233 |
import os
REFERENCE_FILENAME = 'rpc_interface.txt'
class AuthServiceProxyWrapper():
def __init__(self, auth_service_proxy_instance, coverage_logfile=None):
self.auth_service_proxy_instance = auth_service_proxy_instance
self.coverage_logfile = coverage_logfile
def __getattr__(self, name... | true | true |
1c1d0e79845de6188050e0471d8c87079a45b681 | 14,227 | py | Python | research/lstm_object_detection/lstm/lstm_cells_test.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 3 | 2017-07-11T15:12:06.000Z | 2018-01-07T11:53:44.000Z | research/lstm_object_detection/lstm/lstm_cells_test.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 6 | 2021-06-08T21:30:48.000Z | 2022-03-12T00:29:00.000Z | research/lstm_object_detection/lstm/lstm_cells_test.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 7 | 2017-07-01T22:47:51.000Z | 2021-05-15T10:48:22.000Z | # Copyright 2018 The TensorFlow 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 applica... | 34.447942 | 80 | 0.664722 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from lstm_object_detection.lstm import lstm_cells
class BottleneckConvLstmCellsTest(tf.test.TestCase):
def test_run_lstm_cell(self):
filter_si... | true | true |
1c1d0e9103aea854e3698ff92298a869cd0b91fb | 4,630 | py | Python | analysis-scripts/plot_hbonds.py | rnowling/openmm-simulation-examples | 715d465e7548999d6fff7febdf5945f389db8083 | [
"Apache-2.0"
] | null | null | null | analysis-scripts/plot_hbonds.py | rnowling/openmm-simulation-examples | 715d465e7548999d6fff7febdf5945f389db8083 | [
"Apache-2.0"
] | 5 | 2017-01-30T03:54:44.000Z | 2017-01-30T04:32:35.000Z | analysis-scripts/plot_hbonds.py | rnowling/openmm-simulation-examples | 715d465e7548999d6fff7febdf5945f389db8083 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2017 Ronald J. Nowling
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... | 31.712329 | 83 | 0.564795 | """
Copyright 2017 Ronald J. Nowling
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... | false | true |
1c1d0ea6b280dc7c1ee9532bb2147a2cf5e2ecff | 590 | py | Python | venvBlog/Lib/site-packages/model_mommy/timezone.py | msidargo/msidargo_blog | 7b412e30532ddab23e81e1a0f5e9a44cd2e7f108 | [
"MIT"
] | 448 | 2015-01-01T15:12:05.000Z | 2018-12-11T12:16:58.000Z | venvBlog/Lib/site-packages/model_mommy/timezone.py | msidargo/msidargo_blog | 7b412e30532ddab23e81e1a0f5e9a44cd2e7f108 | [
"MIT"
] | 161 | 2015-01-09T03:52:48.000Z | 2018-12-11T22:06:52.000Z | venvBlog/Lib/site-packages/model_mommy/timezone.py | msidargo/msidargo_blog | 7b412e30532ddab23e81e1a0f5e9a44cd2e7f108 | [
"MIT"
] | 109 | 2015-01-15T00:36:52.000Z | 2018-07-26T11:22:50.000Z | """
Add support for Django 1.4+ safe datetimes.
https://docs.djangoproject.com/en/1.4/topics/i18n/timezones/
"""
# TODO: the whole file seems to be not needed anymore, since Django has this tooling built-in
from datetime import datetime
try:
from django.conf import settings
from django.utils.timezone import n... | 21.071429 | 93 | 0.69661 |
from datetime import datetime
try:
from django.conf import settings
from django.utils.timezone import now, utc
except ImportError:
def now():
return datetime.now()
def smart_datetime(*args):
value = datetime(*args)
return tz_aware(value)
def tz_aware(d):
value = d
if settings.... | true | true |
1c1d0f1a735cf1fe3055b46ceeb86b6f666e6a15 | 2,985 | py | Python | pandas/tests/indexes/timedeltas/test_timedelta_range.py | LauraCollard/pandas | b1c3a9031569334cafc4e8d45d35408421f7dea4 | [
"BSD-3-Clause"
] | 5 | 2019-07-26T15:22:41.000Z | 2021-09-28T09:22:17.000Z | pandas/tests/indexes/timedeltas/test_timedelta_range.py | ivan-vasilev/pandas | 4071dde86e33434e1bee8304fa62074949f813cc | [
"BSD-3-Clause"
] | 16 | 2021-03-19T09:44:52.000Z | 2022-03-12T00:22:14.000Z | pandas/tests/indexes/timedeltas/test_timedelta_range.py | ivan-vasilev/pandas | 4071dde86e33434e1bee8304fa62074949f813cc | [
"BSD-3-Clause"
] | 9 | 2020-02-05T10:24:12.000Z | 2020-02-10T13:08:50.000Z | import numpy as np
import pytest
import pandas as pd
from pandas import timedelta_range, to_timedelta
import pandas.util.testing as tm
from pandas.tseries.offsets import Day, Second
class TestTimedeltas:
def test_timedelta_range(self):
expected = to_timedelta(np.arange(5), unit="D")
result = ti... | 36.851852 | 85 | 0.603685 | import numpy as np
import pytest
import pandas as pd
from pandas import timedelta_range, to_timedelta
import pandas.util.testing as tm
from pandas.tseries.offsets import Day, Second
class TestTimedeltas:
def test_timedelta_range(self):
expected = to_timedelta(np.arange(5), unit="D")
result = ti... | true | true |
1c1d0f4cd7e5a7e1c088d3dcc35705d3ee9aa287 | 4,299 | py | Python | cat-droidbot/droidbot/adapter/droidbot.py | chao-peng/CAT | 65e12029e8a7c0c53be5ac011997281117e054f0 | [
"MIT"
] | 563 | 2016-06-03T06:18:13.000Z | 2022-03-23T10:46:39.000Z | cat-droidbot/droidbot/adapter/droidbot.py | chao-peng/CAT | 65e12029e8a7c0c53be5ac011997281117e054f0 | [
"MIT"
] | 85 | 2016-06-05T03:52:25.000Z | 2022-03-31T11:34:21.000Z | cat-droidbot/droidbot/adapter/droidbot.py | chao-peng/CAT | 65e12029e8a7c0c53be5ac011997281117e054f0 | [
"MIT"
] | 181 | 2016-06-30T13:48:35.000Z | 2022-03-13T06:39:07.000Z | import logging
import subprocess
from .adapter import Adapter
class DroidBotConnException(Exception):
"""
Exception in telnet connection
"""
pass
class EOF(Exception):
"""
Exception in telnet connection
"""
pass
class DroidBotConn(Adapter):
"""
a connection with DroidBot.
... | 30.062937 | 76 | 0.554082 | import logging
import subprocess
from .adapter import Adapter
class DroidBotConnException(Exception):
pass
class EOF(Exception):
pass
class DroidBotConn(Adapter):
def __init__(self, device_unique_id,
app_path=None,
device_serial=None,
is_emulator=Fa... | true | true |
1c1d0fb2601711c2bb6f5fd3dca7c2b1fd49a033 | 10,832 | py | Python | examples/encoding/create_simple_mp4_smooth_playready_encoding.py | camberbridge/bitmovin-python | 3af4c6e79b0291fda05fd1ceeb5bed1bba9f3c95 | [
"Unlicense"
] | 44 | 2016-12-12T17:37:23.000Z | 2021-03-03T09:48:48.000Z | examples/encoding/create_simple_mp4_smooth_playready_encoding.py | camberbridge/bitmovin-python | 3af4c6e79b0291fda05fd1ceeb5bed1bba9f3c95 | [
"Unlicense"
] | 38 | 2017-01-09T14:45:45.000Z | 2022-02-27T18:04:33.000Z | examples/encoding/create_simple_mp4_smooth_playready_encoding.py | camberbridge/bitmovin-python | 3af4c6e79b0291fda05fd1ceeb5bed1bba9f3c95 | [
"Unlicense"
] | 27 | 2017-02-02T22:49:31.000Z | 2019-11-21T07:04:57.000Z | import datetime
from bitmovin import Bitmovin, Encoding, S3Input, S3Output, H264CodecConfiguration, \
AACCodecConfiguration, H264Profile, StreamInput, SelectionMode, Stream, EncodingOutput, ACLEntry, ACLPermission, \
MP4Muxing, MuxingStream, CloudRegion, SmoothManifest, MP4Representation, PlayReadyDRM, PlayRead... | 54.16 | 147 | 0.612537 | import datetime
from bitmovin import Bitmovin, Encoding, S3Input, S3Output, H264CodecConfiguration, \
AACCodecConfiguration, H264Profile, StreamInput, SelectionMode, Stream, EncodingOutput, ACLEntry, ACLPermission, \
MP4Muxing, MuxingStream, CloudRegion, SmoothManifest, MP4Representation, PlayReadyDRM, PlayRead... | true | true |
1c1d105452ddd227b2a826eeb3d44872cc2f7d78 | 491 | py | Python | tests/test_string_methods.py | Dreanaught/pyjucontrol | 52113781499168d4248c9e94e9473ad317fdb36d | [
"MIT"
] | null | null | null | tests/test_string_methods.py | Dreanaught/pyjucontrol | 52113781499168d4248c9e94e9473ad317fdb36d | [
"MIT"
] | null | null | null | tests/test_string_methods.py | Dreanaught/pyjucontrol | 52113781499168d4248c9e94e9473ad317fdb36d | [
"MIT"
] | null | null | null | import unittest
class TestStringMethods(unittest.TestCase):
def test_upper(self):
self.assertEqual('foo'.upper(), 'FOO')
def test_isupper(self):
self.assertTrue('FOO'.isupper())
self.assertFalse('Foo'.isupper())
def test_split(self):
s = 'hello world'
self.assertE... | 28.882353 | 69 | 0.623218 | import unittest
class TestStringMethods(unittest.TestCase):
def test_upper(self):
self.assertEqual('foo'.upper(), 'FOO')
def test_isupper(self):
self.assertTrue('FOO'.isupper())
self.assertFalse('Foo'.isupper())
def test_split(self):
s = 'hello world'
self.assertE... | true | true |
1c1d1145b0091b1baadbe5caf19744c72b32fa69 | 6,339 | py | Python | lib/inmsg.py | mdenhartog/InnovateNowOutdoorTracker | 136136416e71b4c641f5c45e4aae47317b3bbd6b | [
"MIT"
] | null | null | null | lib/inmsg.py | mdenhartog/InnovateNowOutdoorTracker | 136136416e71b4c641f5c45e4aae47317b3bbd6b | [
"MIT"
] | null | null | null | lib/inmsg.py | mdenhartog/InnovateNowOutdoorTracker | 136136416e71b4c641f5c45e4aae47317b3bbd6b | [
"MIT"
] | null | null | null | # 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, modify, merge, publish, distribute, sublicense, and/or sell
# copi... | 27.089744 | 105 | 0.603565 |
import json
import time
class Message(object):
def __init__(self):
self.message = dict()
def to_dict(self):
return self.message
def to_json(self):
return json.dumps(self.message)
class GPSMessage(Message):
def __init__(self, id=None, latitude=None, long... | true | true |
1c1d12252defa1943a6c02bb5a2dc3723ae23b40 | 5,149 | py | Python | asados/views.py | TenStrings/organizador-de-asados | 5f8ede2ca5c8f9d2faf7fec316c4014142113464 | [
"MIT"
] | null | null | null | asados/views.py | TenStrings/organizador-de-asados | 5f8ede2ca5c8f9d2faf7fec316c4014142113464 | [
"MIT"
] | null | null | null | asados/views.py | TenStrings/organizador-de-asados | 5f8ede2ca5c8f9d2faf7fec316c4014142113464 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.http import HttpResponse, HttpResponseRedirect
from django.template.loader import get_template
from datetime import datetime
from .models import (
Asado,
User,
Invitation,
Assignment,
AssignmentValidationError
)
from .forms import AddAsadoFor... | 26.137056 | 70 | 0.54496 | from django.shortcuts import render, redirect
from django.http import HttpResponse, HttpResponseRedirect
from django.template.loader import get_template
from datetime import datetime
from .models import (
Asado,
User,
Invitation,
Assignment,
AssignmentValidationError
)
from .forms import AddAsadoFor... | true | true |
1c1d12536ff12b34e07a8cfabb3dfe62368f7f2c | 3,285 | py | Python | otp/distributed/OtpDoGlobals.py | ksmit799/POTCO-PS | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 8 | 2017-01-24T04:33:29.000Z | 2020-11-01T08:36:24.000Z | otp/distributed/OtpDoGlobals.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 1 | 2017-03-02T18:05:17.000Z | 2017-03-14T06:47:10.000Z | otp/distributed/OtpDoGlobals.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 11 | 2017-03-02T18:46:07.000Z | 2020-11-01T08:36:26.000Z | from direct.distributed.MsgTypes import *
OTP_DO_ID_SERVER_ROOT = 4007
OTP_DO_ID_FRIEND_MANAGER = 4501
OTP_DO_ID_LEADERBOARD_MANAGER = 4502
OTP_DO_ID_SERVER = 4600
OTP_DO_ID_UBER_DOG = 4601
OTP_CHANNEL_AI_AND_UD_BROADCAST = 4602
OTP_CHANNEL_UD_BROADCAST = 4603
OTP_CHANNEL_AI_BROADCAST = 4604
OTP_NET_MSGR_CHANNEL_ID_AL... | 36.098901 | 79 | 0.887671 | from direct.distributed.MsgTypes import *
OTP_DO_ID_SERVER_ROOT = 4007
OTP_DO_ID_FRIEND_MANAGER = 4501
OTP_DO_ID_LEADERBOARD_MANAGER = 4502
OTP_DO_ID_SERVER = 4600
OTP_DO_ID_UBER_DOG = 4601
OTP_CHANNEL_AI_AND_UD_BROADCAST = 4602
OTP_CHANNEL_UD_BROADCAST = 4603
OTP_CHANNEL_AI_BROADCAST = 4604
OTP_NET_MSGR_CHANNEL_ID_AL... | true | true |
1c1d161b8687d60d92f235ff45ed2d1dc99bfa9b | 12,488 | py | Python | nautobot/extras/tests/test_relationships.py | jtschichold/nautobot | 71c61cbbd23301111c281ed1d908a026ea2e4e07 | [
"Apache-2.0"
] | 1 | 2022-01-11T10:33:50.000Z | 2022-01-11T10:33:50.000Z | nautobot/extras/tests/test_relationships.py | jtschichold/nautobot | 71c61cbbd23301111c281ed1d908a026ea2e4e07 | [
"Apache-2.0"
] | null | null | null | nautobot/extras/tests/test_relationships.py | jtschichold/nautobot | 71c61cbbd23301111c281ed1d908a026ea2e4e07 | [
"Apache-2.0"
] | null | null | null | from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
from nautobot.dcim.models import Site, Rack
from nautobot.ipam.models import VLAN
from nautobot.extras.choices import *
from nautobot.extras.models import Relationship, RelationshipAssociation
from nautobot.ut... | 40.154341 | 119 | 0.650625 | from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
from nautobot.dcim.models import Site, Rack
from nautobot.ipam.models import VLAN
from nautobot.extras.choices import *
from nautobot.extras.models import Relationship, RelationshipAssociation
from nautobot.ut... | true | true |
1c1d165f5ddd0bec12b2ca81e059f5c1c1c7992f | 2,424 | py | Python | crawling-web-python-scrapy/02/demos/m2.py | Pradeepgb10/web-scraping | 433aa8dd62c1e858bc8d9bd4a995a79a912c1782 | [
"Apache-2.0"
] | null | null | null | crawling-web-python-scrapy/02/demos/m2.py | Pradeepgb10/web-scraping | 433aa8dd62c1e858bc8d9bd4a995a79a912c1782 | [
"Apache-2.0"
] | null | null | null | crawling-web-python-scrapy/02/demos/m2.py | Pradeepgb10/web-scraping | 433aa8dd62c1e858bc8d9bd4a995a79a912c1782 | [
"Apache-2.0"
] | null | null | null | #pip install requests - 1
#pip install lxml - 4
#pip install htmlparser - 5
#pip install selectolax - 6
#pip install beautifulsoup4 - 7
import requests #2
import re #3
import lxml.html
from selectolax.parser import HTMLParser
from bs4 import BeautifulSoup
import timeit
# 8
def extractLinksRegEx(txt)... | 21.078261 | 70 | 0.554868 |
import requests
import re
import lxml.html
from selectolax.parser import HTMLParser
from bs4 import BeautifulSoup
import timeit
def extractLinksRegEx(txt):
tgs = re.compile(r'<a[^<>]+?href=([\'\"])(.*?)\1', re.IGNORECASE)
return [match[1] for match in tgs.findall(txt)]
#13
def extractL... | true | true |
1c1d17ca07a5a2c7e2f6593873839862788bdf9d | 6,980 | py | Python | clipl/analysis_modules/unfolding.py | thomas-mueller/clipl | 4c8c61dd4a09fee6ad2ec65f3baa6854cf9cce69 | [
"MIT"
] | null | null | null | clipl/analysis_modules/unfolding.py | thomas-mueller/clipl | 4c8c61dd4a09fee6ad2ec65f3baa6854cf9cce69 | [
"MIT"
] | null | null | null | clipl/analysis_modules/unfolding.py | thomas-mueller/clipl | 4c8c61dd4a09fee6ad2ec65f3baa6854cf9cce69 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
import clipl.utility.logger as logger
log = logging.getLogger(__name__)
import ROOT
import copy
import math
import os
import clipl.analysisbase as analysisbase
class Unfolding(analysisbase.AnalysisBase):
"""This module implements an unfolding procedure based on RooUnfold.
... | 42.048193 | 345 | 0.689971 |
import logging
import clipl.utility.logger as logger
log = logging.getLogger(__name__)
import ROOT
import copy
import math
import os
import clipl.analysisbase as analysisbase
class Unfolding(analysisbase.AnalysisBase):
"""This module implements an unfolding procedure based on RooUnfold.
Needed are
- Th... | false | true |
1c1d17f8705e2b0a109add3173b464b8a43f6e8b | 43,687 | py | Python | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/__init__.py | jhkuang11/UniTrade | 5f68b853926e167936b58c8543b8f95ebd6f5211 | [
"MIT"
] | null | null | null | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/__init__.py | jhkuang11/UniTrade | 5f68b853926e167936b58c8543b8f95ebd6f5211 | [
"MIT"
] | 10 | 2020-06-05T19:42:26.000Z | 2022-03-11T23:38:35.000Z | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/__init__.py | jhkuang11/UniTrade | 5f68b853926e167936b58c8543b8f95ebd6f5211 | [
"MIT"
] | null | null | null | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2017, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
"""Implements the... | 32.724345 | 113 | 0.496647 | conn.execute_dict(SQL)
if not status:
return internal_server_error(errormsg=res)
if 'inherits' in res['rows'][0]:
data[key] = res['rows'][0]['inherits']
... | true | true |
1c1d1964bdf7859594107f18c5cd8dd6d6f6ab68 | 4,774 | py | Python | colcon_bundle/verb/bundlefile.py | rotu/colcon-bundle | b57dd328dca2750b31c6303e587d70913a9dfe9d | [
"Apache-2.0"
] | 31 | 2018-10-19T18:16:37.000Z | 2021-07-05T06:54:38.000Z | colcon_bundle/verb/bundlefile.py | rotu/colcon-bundle | b57dd328dca2750b31c6303e587d70913a9dfe9d | [
"Apache-2.0"
] | 113 | 2018-10-24T17:33:50.000Z | 2022-02-08T20:36:19.000Z | colcon_bundle/verb/bundlefile.py | rotu/colcon-bundle | b57dd328dca2750b31c6303e587d70913a9dfe9d | [
"Apache-2.0"
] | 30 | 2018-10-19T18:16:08.000Z | 2022-03-24T01:21:27.000Z | import json
import math
import os
import tarfile
import tempfile
from colcon_core.logging import colcon_logger
from .utilities import filechecksum
logger = colcon_logger.getChild(__name__)
# Size in bytes
MAX_METADATA_SIZE = 4 * 1024 * 1024
# tarfile format used in bundlefiles
TARFILE_FORMAT = tarfile.GNU_FORMAT
... | 34.846715 | 79 | 0.568705 | import json
import math
import os
import tarfile
import tempfile
from colcon_core.logging import colcon_logger
from .utilities import filechecksum
logger = colcon_logger.getChild(__name__)
MAX_METADATA_SIZE = 4 * 1024 * 1024
TARFILE_FORMAT = tarfile.GNU_FORMAT
class Bundle:
def __init__(self, *, name=None... | true | true |
1c1d196c099e82ea1700bae0b02b8d6d4b69497a | 337 | py | Python | dumpAttr.py | winksaville/cadquery-wing1 | 43da6a179e1a527401a4328764f3726048d66339 | [
"MIT"
] | null | null | null | dumpAttr.py | winksaville/cadquery-wing1 | 43da6a179e1a527401a4328764f3726048d66339 | [
"MIT"
] | null | null | null | dumpAttr.py | winksaville/cadquery-wing1 | 43da6a179e1a527401a4328764f3726048d66339 | [
"MIT"
] | null | null | null | """
Dump attributes of an object
From: https://blender.stackexchange.com/questions/1879/is-it-possible-to-dump-an-objects-properties-and-methods
"""
def dumpAttr(obj):
"""
Dump attributes of the object
"""
for attr in dir(obj):
if hasattr( obj, attr ):
print(f'obj.{attr} = {getatt... | 24.071429 | 113 | 0.632047 |
def dumpAttr(obj):
for attr in dir(obj):
if hasattr( obj, attr ):
print(f'obj.{attr} = {getattr(obj, attr)}')
| true | true |
1c1d196e504c31f061ab177ecda3d39f05982484 | 9,689 | py | Python | book_env/Lib/site-packages/ipympl/backend_nbagg.py | dirangill/Hands-On-Data-Analysis-with-Pandas-2nd-edition | 580ee52cf37e5ddee54470aa0526da2a5ca9b310 | [
"MIT"
] | null | null | null | book_env/Lib/site-packages/ipympl/backend_nbagg.py | dirangill/Hands-On-Data-Analysis-with-Pandas-2nd-edition | 580ee52cf37e5ddee54470aa0526da2a5ca9b310 | [
"MIT"
] | null | null | null | book_env/Lib/site-packages/ipympl/backend_nbagg.py | dirangill/Hands-On-Data-Analysis-with-Pandas-2nd-edition | 580ee52cf37e5ddee54470aa0526da2a5ca9b310 | [
"MIT"
] | null | null | null | """Interactive figures in the Jupyter notebook"""
from base64 import b64encode
import json
import io
from IPython.display import display, HTML
from ipywidgets import DOMWidget, widget_serialization
from traitlets import (
Unicode, Bool, CInt, Float, List, Instance, CaselessStrEnum, Enum,
default
)
from matp... | 32.296667 | 78 | 0.62091 |
from base64 import b64encode
import json
import io
from IPython.display import display, HTML
from ipywidgets import DOMWidget, widget_serialization
from traitlets import (
Unicode, Bool, CInt, Float, List, Instance, CaselessStrEnum, Enum,
default
)
from matplotlib import rcParams
from matplotlib.figure impo... | true | true |
1c1d1ab14a40ca73b53cfbe54684716bd46acf18 | 7,157 | py | Python | kubernetes_asyncio/client/models/v1_cluster_role.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1_cluster_role.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1_cluster_role.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.14.7
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1ClusterR... | 32.09417 | 295 | 0.618555 |
import pprint
import re
import six
class V1ClusterRole(object):
openapi_types = {
'aggregation_rule': 'V1AggregationRule',
'api_version': 'str',
'kind': 'str',
'metadata': 'V1ObjectMeta',
'rules': 'list[V1PolicyRule]'
}
attribute_map = {
'aggregatio... | true | true |
1c1d1caa9200920284c13d314d014c8248c3e303 | 2,838 | py | Python | sdk/managementgroups/azure-mgmt-managementgroups/setup.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/managementgroups/azure-mgmt-managementgroups/setup.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | sdk/managementgroups/azure-mgmt-managementgroups/setup.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | 32.25 | 91 | 0.599718 |
import re
import os.path
from io import open
from setuptools import find_packages, setup
PACKAGE_NAME = "azure-mgmt-managementgroups"
PACKAGE_PPRINT_NAME = "Management Groups"
package_folder_path = PACKAGE_NAME.replace('-', '/')
namespace_name = PACKAGE_NAME.replace('-', '.')
try:
import azure
t... | true | true |
1c1d1dd74ba2713869bfa5b91f7d994884cce1f9 | 218 | py | Python | setup.py | dllahr/summer2020 | 4c8204f72ecdd8c44d2abb1e3e2669d1e6a478e8 | [
"MIT"
] | null | null | null | setup.py | dllahr/summer2020 | 4c8204f72ecdd8c44d2abb1e3e2669d1e6a478e8 | [
"MIT"
] | null | null | null | setup.py | dllahr/summer2020 | 4c8204f72ecdd8c44d2abb1e3e2669d1e6a478e8 | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(name="summer2020py", version="0.0.1", description="python code for Summer 2020",
packages=setuptools.find_packages(),
install_requires=["pandas>=0.20.3", "openpyxl>=2.5.1"])
| 36.333333 | 97 | 0.729358 | import setuptools
setuptools.setup(name="summer2020py", version="0.0.1", description="python code for Summer 2020",
packages=setuptools.find_packages(),
install_requires=["pandas>=0.20.3", "openpyxl>=2.5.1"])
| true | true |
1c1d1f7da8272dd1b52ab408139a072588acd0db | 444 | py | Python | planet/shell/sed.py | gentoo/venus | b15226aff01f491580ea5cfc515e2ef468c700a5 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | planet/shell/sed.py | gentoo/venus | b15226aff01f491580ea5cfc515e2ef468c700a5 | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2020-02-25T13:00:07.000Z | 2020-02-25T13:00:07.000Z | planet/shell/sed.py | aliceinwire/venus | b15226aff01f491580ea5cfc515e2ef468c700a5 | [
"CNRI-Python-GPL-Compatible"
] | 4 | 2015-07-14T14:35:43.000Z | 2020-12-06T21:43:38.000Z | from subprocess import Popen, PIPE
def run(script, doc, output_file=None, options={}):
""" process an Python script """
if output_file:
out = open(output_file, 'w')
else:
out = PIPE
proc = Popen(['sed', '-f', script],
stdin=PIPE, stdout=out, stderr=PIPE)
stdout,... | 21.142857 | 53 | 0.59009 | from subprocess import Popen, PIPE
def run(script, doc, output_file=None, options={}):
if output_file:
out = open(output_file, 'w')
else:
out = PIPE
proc = Popen(['sed', '-f', script],
stdin=PIPE, stdout=out, stderr=PIPE)
stdout, stderr = proc.communicate(doc)
i... | true | true |
1c1d1f88bd563192fae83a4efb4fa273593d0da1 | 627 | py | Python | test/test_zim2markdown.py | polosaty/markdown2zim | cc00fefc045fc47a0e31d82259eab1a90c029f27 | [
"MIT"
] | null | null | null | test/test_zim2markdown.py | polosaty/markdown2zim | cc00fefc045fc47a0e31d82259eab1a90c029f27 | [
"MIT"
] | null | null | null | test/test_zim2markdown.py | polosaty/markdown2zim | cc00fefc045fc47a0e31d82259eab1a90c029f27 | [
"MIT"
] | 1 | 2018-10-07T16:10:43.000Z | 2018-10-07T16:10:43.000Z | import zim2markdown
text="""
===== heading1 =====
==== heading2 ====
=== heading3 ===
== heading4 ==
= heading5 =
= heading6 =
this is test //**bold test**// of markdown ** ~~parser~~
test.
* item1;
* item2;
* item3.
1. num1;
2. num2;
3. num3.
'''
this is a quote block,
still a quote block,
quote block contin... | 11.830189 | 56 | 0.631579 | import zim2markdown
text="""
===== heading1 =====
==== heading2 ====
=== heading3 ===
== heading4 ==
= heading5 =
= heading6 =
this is test //**bold test**// of markdown ** ~~parser~~
test.
* item1;
* item2;
* item3.
1. num1;
2. num2;
3. num3.
'''
this is a quote block,
still a quote block,
quote block contin... | false | true |
1c1d1ffdf97c121d6be639b371521366123e5930 | 1,976 | py | Python | python-ref/python-make/python.py | bogen/makeshells | a61ca2f9d35417d081a5c07c6c973d6039d39c38 | [
"MIT"
] | 1 | 2019-10-16T12:15:53.000Z | 2019-10-16T12:15:53.000Z | python-ref/python-make/python.py | bogen/makeshells | a61ca2f9d35417d081a5c07c6c973d6039d39c38 | [
"MIT"
] | null | null | null | python-ref/python-make/python.py | bogen/makeshells | a61ca2f9d35417d081a5c07c6c973d6039d39c38 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# this is pure python, not a make/python hybrid
# this is the make shell
#!/usr/bin/env pypy3
#### #### #### #### #### #### #### #### #### #### #### #### #### #### ####
#### #### #### #### #### #### #### #### #### #### #### #### #### #### ####
import sys
import traceback
import os.path
#### ... | 27.068493 | 74 | 0.426619 | true | true | |
1c1d217d3e630d5b8ac6dd1230a0f3bfaaeaf1d7 | 353 | py | Python | setup.py | simonsobs/soaculib | db829e74f9feba06b3b90e2b0fc997a4c86ae683 | [
"BSD-2-Clause"
] | 1 | 2022-02-16T22:33:46.000Z | 2022-02-16T22:33:46.000Z | setup.py | simonsobs/soaculib | db829e74f9feba06b3b90e2b0fc997a4c86ae683 | [
"BSD-2-Clause"
] | null | null | null | setup.py | simonsobs/soaculib | db829e74f9feba06b3b90e2b0fc997a4c86ae683 | [
"BSD-2-Clause"
] | null | null | null | from setuptools import setup
import versioneer
setup(name='soaculib',
description='ACU Control Library for Simons Observatory',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
package_dir={'soaculib': 'python'},
packages=['soaculib'],
scripts=['scripts/acu-hea... | 27.153846 | 63 | 0.696884 | from setuptools import setup
import versioneer
setup(name='soaculib',
description='ACU Control Library for Simons Observatory',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
package_dir={'soaculib': 'python'},
packages=['soaculib'],
scripts=['scripts/acu-hea... | true | true |
1c1d221771a86675452a3471b5540c6896252de7 | 2,311 | py | Python | cogs/crypto.py | JamesNgai/qtbot | 6dc6bb4c0bd132c385bf8dc4cb6bf4550eabdccd | [
"MIT"
] | 1 | 2019-08-17T16:06:20.000Z | 2019-08-17T16:06:20.000Z | cogs/crypto.py | JamesNgai/qtbot | 6dc6bb4c0bd132c385bf8dc4cb6bf4550eabdccd | [
"MIT"
] | null | null | null | cogs/crypto.py | JamesNgai/qtbot | 6dc6bb4c0bd132c385bf8dc4cb6bf4550eabdccd | [
"MIT"
] | null | null | null | import datetime
import json
import discord
from discord.ext import commands
from utils import aiohttp_wrap as aw
class Crypto(commands.Cog):
""" Allows users to track bitcoin and other currencies (eventually) """
URL_BTC = 'https://api.coinmarketcap.com/v1/ticker/bitcoin'
BTC_LOGO_URL = 'https://en.bitco... | 37.885246 | 112 | 0.651233 | import datetime
import json
import discord
from discord.ext import commands
from utils import aiohttp_wrap as aw
class Crypto(commands.Cog):
URL_BTC = 'https://api.coinmarketcap.com/v1/ticker/bitcoin'
BTC_LOGO_URL = 'https://en.bitcoin.it/w/images/en/2/29/BC_Logo_.png'
def __init__(self, bot):
... | true | true |
1c1d224dbc1a4347b628fd5001849279b1beb142 | 647 | py | Python | app/ext/api/services/file_services.py | fredsonchaves07/foodfy | 5bff04434749f369f982090b00590cca31fce186 | [
"MIT"
] | null | null | null | app/ext/api/services/file_services.py | fredsonchaves07/foodfy | 5bff04434749f369f982090b00590cca31fce186 | [
"MIT"
] | 141 | 2021-03-03T01:38:10.000Z | 2022-01-16T15:42:02.000Z | app/ext/api/services/file_services.py | fredsonchaves07/foodfy | 5bff04434749f369f982090b00590cca31fce186 | [
"MIT"
] | null | null | null | from app.ext.api.models.file import Files
from app.ext.database import db
def create_file(filename, path):
file = Files()
file.name = filename
file.path = path
db.session.add(file)
db.session.commit()
return file.as_dict()
def update_file(file_id, filename, path):
file = get_file_by_i... | 16.589744 | 52 | 0.680062 | from app.ext.api.models.file import Files
from app.ext.database import db
def create_file(filename, path):
file = Files()
file.name = filename
file.path = path
db.session.add(file)
db.session.commit()
return file.as_dict()
def update_file(file_id, filename, path):
file = get_file_by_i... | true | true |
1c1d2257faf24d6f8c4f33480c24acd92c48037c | 1,168 | py | Python | TemporaryStorage/providers/telegraph/__init__.py | ulbwazhine/TemporaryStorage | 3e28ecd2113e8f5a66e7652be12e5444f729d5bb | [
"MIT"
] | null | null | null | TemporaryStorage/providers/telegraph/__init__.py | ulbwazhine/TemporaryStorage | 3e28ecd2113e8f5a66e7652be12e5444f729d5bb | [
"MIT"
] | null | null | null | TemporaryStorage/providers/telegraph/__init__.py | ulbwazhine/TemporaryStorage | 3e28ecd2113e8f5a66e7652be12e5444f729d5bb | [
"MIT"
] | null | null | null | import requests
from dataclasses import dataclass
from typing import Optional
from TemporaryStorage.providers import Provider, File, HostedFile
@dataclass
class ProviderInstance(Provider):
def __provider_init__(self):
self.provider = 'Telegraph'
self.max_file_size = 50
self.min_retention ... | 29.2 | 93 | 0.595034 | import requests
from dataclasses import dataclass
from typing import Optional
from TemporaryStorage.providers import Provider, File, HostedFile
@dataclass
class ProviderInstance(Provider):
def __provider_init__(self):
self.provider = 'Telegraph'
self.max_file_size = 50
self.min_retention ... | true | true |
1c1d233f3266b41435e4e39bc4dc12fbe51f909a | 321 | py | Python | source/config.py | rongxuanhong/CallNameBackEnd | 8197b69a8fa5909afce853bae3a020dd20a1c83c | [
"MIT"
] | null | null | null | source/config.py | rongxuanhong/CallNameBackEnd | 8197b69a8fa5909afce853bae3a020dd20a1c83c | [
"MIT"
] | null | null | null | source/config.py | rongxuanhong/CallNameBackEnd | 8197b69a8fa5909afce853bae3a020dd20a1c83c | [
"MIT"
] | null | null | null | class Config(object):
SECRET_KEY = 'key'
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:mysql@localhost:3306/projectdb?charset=utf8mb4&use_unicode=1'
SQLALCHEMY_TRACK_MODIFICATIONS = False
class ProductionConfig(Config):
DEBUG = False
class DebugConfig(Config):
DEBUG = True
permissions = [""]... | 20.0625 | 113 | 0.735202 | class Config(object):
SECRET_KEY = 'key'
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:mysql@localhost:3306/projectdb?charset=utf8mb4&use_unicode=1'
SQLALCHEMY_TRACK_MODIFICATIONS = False
class ProductionConfig(Config):
DEBUG = False
class DebugConfig(Config):
DEBUG = True
permissions = [""]... | true | true |
1c1d23622f63a550f9a14f5d6bce16d72c97201f | 509 | py | Python | python/GuessNumberHigherOrLower.py | JumHorn/leetcode | 1447237ae8fc3920b19f60b30c71a84b088cc200 | [
"MIT"
] | 1 | 2018-01-22T12:06:28.000Z | 2018-01-22T12:06:28.000Z | python/GuessNumberHigherOrLower.py | JumHorn/leetcode | 1447237ae8fc3920b19f60b30c71a84b088cc200 | [
"MIT"
] | null | null | null | python/GuessNumberHigherOrLower.py | JumHorn/leetcode | 1447237ae8fc3920b19f60b30c71a84b088cc200 | [
"MIT"
] | null | null | null | # The guess API is already defined for you.
# @param num, your guess
# @return -1 if my number is lower, 1 if my number is higher, otherwise return 0
def guess(num: int) -> int:
class Solution:
def guessNumber(self, n: int) -> int:
lo, hi = 1, n
while lo < hi:
mi = (hi - lo) // 2 + lo
... | 25.45 | 80 | 0.459725 |
def guess(num: int) -> int:
class Solution:
def guessNumber(self, n: int) -> int:
lo, hi = 1, n
while lo < hi:
mi = (hi - lo) // 2 + lo
g = guess(mi)
if g == 0:
return mi
if g > 0:
lo = mi + 1
else:
... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.