hexsha stringlengths 40 40 | size int64 10 805k | ext stringclasses 6
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 176 | max_stars_repo_name stringlengths 7 114 | 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 176 | max_issues_repo_name stringlengths 7 114 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 48.5k ⌀ | 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 176 | max_forks_repo_name stringlengths 7 114 | 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 10 805k | avg_line_length float64 5.53 11k | max_line_length int64 10 129k | alphanum_fraction float64 0.13 0.93 | content_no_comment stringlengths 0 449k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f709a4c39c96d3a1e8421aefec3136f85f663333 | 4,568 | py | Python | readthedocs/search/documents.py | srijan-deepsource/readthedocs.org | ec45216d9ce946a486ef472a8ae3e243742d3aed | [
"MIT"
] | null | null | null | readthedocs/search/documents.py | srijan-deepsource/readthedocs.org | ec45216d9ce946a486ef472a8ae3e243742d3aed | [
"MIT"
] | null | null | null | readthedocs/search/documents.py | srijan-deepsource/readthedocs.org | ec45216d9ce946a486ef472a8ae3e243742d3aed | [
"MIT"
] | 1 | 2020-09-17T08:38:30.000Z | 2020-09-17T08:38:30.000Z | import logging
from django.conf import settings
from django_elasticsearch_dsl import DocType, Index, fields
from elasticsearch import Elasticsearch
from readthedocs.projects.models import HTMLFile, Project
project_conf = settings.ES_INDEXES['project']
project_index = Index(project_conf['name'])
project_index.setting... | 28.911392 | 75 | 0.577496 | import logging
from django.conf import settings
from django_elasticsearch_dsl import DocType, Index, fields
from elasticsearch import Elasticsearch
from readthedocs.projects.models import HTMLFile, Project
project_conf = settings.ES_INDEXES['project']
project_index = Index(project_conf['name'])
project_index.setting... | true | true |
f709a519386f92fbdb79f8035b8677fa2a7251b5 | 2,773 | py | Python | pdm/cli/commands/show.py | julie777/pdm | a6029ca02105d79da4841c701edf73f7315f74eb | [
"MIT"
] | 1 | 2022-03-02T19:43:46.000Z | 2022-03-02T19:43:46.000Z | pdm/cli/commands/show.py | julie777/pdm | a6029ca02105d79da4841c701edf73f7315f74eb | [
"MIT"
] | 1 | 2022-03-20T07:36:27.000Z | 2022-03-20T07:36:27.000Z | pdm/cli/commands/show.py | julie777/pdm | a6029ca02105d79da4841c701edf73f7315f74eb | [
"MIT"
] | null | null | null | import argparse
from packaging.version import Version
from pdm import termui
from pdm.cli.commands.base import BaseCommand
from pdm.exceptions import PdmUsageError
from pdm.models.candidates import Candidate
from pdm.models.project_info import ProjectInfo
from pdm.models.requirements import parse_requirement
from pdm... | 37.986301 | 85 | 0.639019 | import argparse
from packaging.version import Version
from pdm import termui
from pdm.cli.commands.base import BaseCommand
from pdm.exceptions import PdmUsageError
from pdm.models.candidates import Candidate
from pdm.models.project_info import ProjectInfo
from pdm.models.requirements import parse_requirement
from pdm... | true | true |
f709a58c0695a29b53bac9a2a62d67edf3e465a0 | 124 | py | Python | thirdweb/types/collection/__init__.py | princetonwong/python-sdk | f35181d97620e29d055498fca75f3702f3bb2449 | [
"Apache-2.0"
] | 1 | 2022-02-18T16:59:12.000Z | 2022-02-18T16:59:12.000Z | thirdweb/types/collection/__init__.py | princetonwong/python-sdk | f35181d97620e29d055498fca75f3702f3bb2449 | [
"Apache-2.0"
] | null | null | null | thirdweb/types/collection/__init__.py | princetonwong/python-sdk | f35181d97620e29d055498fca75f3702f3bb2449 | [
"Apache-2.0"
] | null | null | null | """
Deprecated. Use types.bundle instead.
"""
from .types import CreateCollectionArg, CollectionMetadata, MintCollectionArg
| 24.8 | 77 | 0.806452 | from .types import CreateCollectionArg, CollectionMetadata, MintCollectionArg
| true | true |
f709a61da35f0ca43aa59d98bda805127bea4373 | 622 | py | Python | examples/dataversity.py | ettoreleandrotognoli/etto-robot | 602b6c00ac925ccdbf33e60f06feb5835c246d31 | [
"Apache-2.0"
] | null | null | null | examples/dataversity.py | ettoreleandrotognoli/etto-robot | 602b6c00ac925ccdbf33e60f06feb5835c246d31 | [
"Apache-2.0"
] | 6 | 2020-12-17T10:19:15.000Z | 2021-03-31T23:23:19.000Z | examples/dataversity.py | ettoreleandrotognoli/etto-robot | 602b6c00ac925ccdbf33e60f06feb5835c246d31 | [
"Apache-2.0"
] | 1 | 2021-08-30T20:38:00.000Z | 2021-08-30T20:38:00.000Z | from robot import Robot
from robot.collector.shortcut import *
collector = pipe(
const('http://www.dataversity.net/category/education/daily-data/'),
get(),
css('#primary article'),
foreach(dict(
pipe(
css('a[href]'), attr('href'), any(), url(),
get(),
dict(
... | 24.88 | 71 | 0.533762 | from robot import Robot
from robot.collector.shortcut import *
collector = pipe(
const('http://www.dataversity.net/category/education/daily-data/'),
get(),
css('#primary article'),
foreach(dict(
pipe(
css('a[href]'), attr('href'), any(), url(),
get(),
dict(
... | true | true |
f709a66c3ccd87f772fd79dba1cc07610dc2d391 | 216 | py | Python | Unidad 2/Ejercicios Plataforma/Ejercicio3.py | angelxehg/utzac-ppy | fb88bcc661518bb35c08a102a67c20d0659f71db | [
"MIT"
] | null | null | null | Unidad 2/Ejercicios Plataforma/Ejercicio3.py | angelxehg/utzac-ppy | fb88bcc661518bb35c08a102a67c20d0659f71db | [
"MIT"
] | null | null | null | Unidad 2/Ejercicios Plataforma/Ejercicio3.py | angelxehg/utzac-ppy | fb88bcc661518bb35c08a102a67c20d0659f71db | [
"MIT"
] | null | null | null | cadena = input("\33[0mIngrese la cadena a separar: \33[34m")
separador = input("\33[0mIngrese el carácter espaciador: \33[34m")[0]
print("\33[0m")
print("Resultado:\33[33m", cadena.replace(' ', separador), "\33[0m")
| 43.2 | 69 | 0.685185 | cadena = input("\33[0mIngrese la cadena a separar: \33[34m")
separador = input("\33[0mIngrese el carácter espaciador: \33[34m")[0]
print("\33[0m")
print("Resultado:\33[33m", cadena.replace(' ', separador), "\33[0m")
| true | true |
f709a7666ac46a954430541cfb50b7e737579f2e | 10,407 | py | Python | high_order_layers_torch/FunctionalConvolution.py | jloveric/high-order-layers-torch | a50ccf0cf82c21fdda4c20c671e7d233a0b6f793 | [
"MIT"
] | 4 | 2021-12-05T11:09:51.000Z | 2021-12-11T20:07:37.000Z | high_order_layers_torch/FunctionalConvolution.py | jloveric/high-order-layers-torch | a50ccf0cf82c21fdda4c20c671e7d233a0b6f793 | [
"MIT"
] | 1 | 2022-03-12T01:03:58.000Z | 2022-03-12T01:03:58.000Z | high_order_layers_torch/FunctionalConvolution.py | jloveric/high-order-layers-torch | a50ccf0cf82c21fdda4c20c671e7d233a0b6f793 | [
"MIT"
] | null | null | null | from .LagrangePolynomial import LagrangeExpand
from pytorch_lightning import LightningModule, Trainer
from high_order_layers_torch.PolynomialLayers import *
from torch.nn import Conv2d
import torch.nn as nn
import torch
from .utils import *
def conv2d_wrapper(
in_channels: int,
out_channels: int,
kernel_... | 38.977528 | 178 | 0.618142 | from .LagrangePolynomial import LagrangeExpand
from pytorch_lightning import LightningModule, Trainer
from high_order_layers_torch.PolynomialLayers import *
from torch.nn import Conv2d
import torch.nn as nn
import torch
from .utils import *
def conv2d_wrapper(
in_channels: int,
out_channels: int,
kernel_... | true | true |
f709a78792f34be38d389105354669425719c2f6 | 459 | py | Python | packages/python/plotly/plotly/validators/parcats/line/colorbar/title/font/_color.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/parcats/line/colorbar/title/font/_color.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/parcats/line/colorbar/title/font/_color.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="color",
parent_name="parcats.line.colorbar.title.font",
**kwargs,
):
super(ColorValidator, self).__init__(
plotly_name=plo... | 27 | 66 | 0.623094 | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="color",
parent_name="parcats.line.colorbar.title.font",
**kwargs,
):
super(ColorValidator, self).__init__(
plotly_name=plo... | true | true |
f709a7abeea7c161af86f8de2d2b4ca3e795964c | 3,261 | py | Python | python/ccxt/test/test_trade.py | DavidFelsen/ccxt | 6497b7da13d2ea3a9e56207b46b8691938b07839 | [
"MIT"
] | 500 | 2017-06-28T14:43:21.000Z | 2022-03-11T14:19:00.000Z | python/ccxt/test/test_trade.py | DavidFelsen/ccxt | 6497b7da13d2ea3a9e56207b46b8691938b07839 | [
"MIT"
] | 214 | 2017-07-03T17:39:26.000Z | 2017-09-20T02:41:20.000Z | python/ccxt/test/test_trade.py | DavidFelsen/ccxt | 6497b7da13d2ea3a9e56207b46b8691938b07839 | [
"MIT"
] | 127 | 2017-06-30T05:49:24.000Z | 2021-11-05T22:39:56.000Z | import numbers # noqa: E402
try:
basestring # basestring was removed in Python 3
except NameError:
basestring = str
def test_trade(exchange, trade, symbol, now):
assert trade
sampleTrade = {
'info': {'a': 1, 'b': 2, 'c': 3}, # the original decoded JSON as is
'id': '12345-67890:098... | 48.671642 | 172 | 0.601349 | import numbers
try:
basestring
except NameError:
basestring = str
def test_trade(exchange, trade, symbol, now):
assert trade
sampleTrade = {
'info': {'a': 1, 'b': 2, 'c': 3},
'id': '12345-67890:09876/54321',
'timestamp': 1502962946216,
'dateti... | true | true |
f709a7ecd6bb9ade98ca43b8a364ed1073609efa | 322 | py | Python | simple_app.py | lykius/hesiod | 091ba1b06cfa870133415fc1df6efdd8e50a2cfe | [
"MIT"
] | 19 | 2020-12-11T15:40:55.000Z | 2022-01-17T16:55:13.000Z | simple_app.py | lykius/hesiod | 091ba1b06cfa870133415fc1df6efdd8e50a2cfe | [
"MIT"
] | null | null | null | simple_app.py | lykius/hesiod | 091ba1b06cfa870133415fc1df6efdd8e50a2cfe | [
"MIT"
] | null | null | null | from pathlib import Path
from pprint import pprint
from hesiod import get_cfg_copy, hmain
template_file = Path("tests/configs/templates/complex.yaml")
base_cfg_dir = Path("tests/configs/bases")
@hmain(base_cfg_dir, template_cfg_file=template_file)
def test() -> None:
cfg = get_cfg_copy()
pprint(cfg)
test(... | 18.941176 | 60 | 0.757764 | from pathlib import Path
from pprint import pprint
from hesiod import get_cfg_copy, hmain
template_file = Path("tests/configs/templates/complex.yaml")
base_cfg_dir = Path("tests/configs/bases")
@hmain(base_cfg_dir, template_cfg_file=template_file)
def test() -> None:
cfg = get_cfg_copy()
pprint(cfg)
test(... | true | true |
f709a7eefbbbaab83c4f1985daeb1cbebd252f53 | 6,119 | py | Python | gita/utils.py | CD3/gita | 9881cf81d46a41ab05ae558e7dcc7dd846a8ce2d | [
"MIT"
] | null | null | null | gita/utils.py | CD3/gita | 9881cf81d46a41ab05ae558e7dcc7dd846a8ce2d | [
"MIT"
] | null | null | null | gita/utils.py | CD3/gita | 9881cf81d46a41ab05ae558e7dcc7dd846a8ce2d | [
"MIT"
] | null | null | null | import os
import yaml
import asyncio
import platform
from functools import lru_cache
from typing import List, Dict, Coroutine, Union
from . import info
from . import common
def get_path_fname() -> str:
"""
Return the file name that stores the repo locations.
"""
root = common.get_config_dir()
ret... | 30.748744 | 90 | 0.618565 | import os
import yaml
import asyncio
import platform
from functools import lru_cache
from typing import List, Dict, Coroutine, Union
from . import info
from . import common
def get_path_fname() -> str:
root = common.get_config_dir()
return os.path.join(root, 'repo_path')
@lru_cache()
def get_repos() -> Dic... | true | true |
f709a7fc512ab2f029c40750148094564f225011 | 4,364 | py | Python | Speech Recognition/Jarvis.py | KALVS/RandomStuff | a347d73ee3621597c6efa731b36194d1743ef36c | [
"MIT"
] | null | null | null | Speech Recognition/Jarvis.py | KALVS/RandomStuff | a347d73ee3621597c6efa731b36194d1743ef36c | [
"MIT"
] | null | null | null | Speech Recognition/Jarvis.py | KALVS/RandomStuff | a347d73ee3621597c6efa731b36194d1743ef36c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Requires PyAudio and PySpeech and more.
import speech_recognition as sr
from time import ctime
import time
import os
from gtts import gTTS
import random
from pygame import mixer
from pyicloud import PyiCloudService
from datetime import date
import re
from re import findall, finditer
from urlli... | 31.623188 | 119 | 0.656279 |
import speech_recognition as sr
from time import ctime
import time
import os
from gtts import gTTS
import random
from pygame import mixer
from pyicloud import PyiCloudService
from datetime import date
import re
from re import findall, finditer
from urllib.request import urlopen
iCloudService = PyiCloudService('icl... | true | true |
f709a87041d5c05d76449fc6fb9f3500d01c2824 | 57,267 | py | Python | timm/models/byobnet.py | KnockerPulsar/pytorch-image-models | 893f5dde27ae6b17389f738bd6e37160e2868c72 | [
"Apache-2.0"
] | null | null | null | timm/models/byobnet.py | KnockerPulsar/pytorch-image-models | 893f5dde27ae6b17389f738bd6e37160e2868c72 | [
"Apache-2.0"
] | null | null | null | timm/models/byobnet.py | KnockerPulsar/pytorch-image-models | 893f5dde27ae6b17389f738bd6e37160e2868c72 | [
"Apache-2.0"
] | null | null | null | """ Bring-Your-Own-Blocks Network
A flexible network w/ dataclass based config for stacking those NN blocks.
This model is currently used to implement the following networks:
GPU Efficient (ResNets) - gernet_l/m/s (original versions called genet, but this was already used (by SENet author)).
Paper: `Neural Ar... | 42.170103 | 134 | 0.626364 | import math
from dataclasses import dataclass, field, replace
from typing import Tuple, List, Dict, Optional, Union, Any, Callable, Sequence
from functools import partial
import torch
import torch.nn as nn
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from .helpers import build_model_with... | true | true |
f709a8d7e31687d2292fa97fcf708ceecab9433b | 285 | py | Python | src/14/14682.py | youngdaLee/Baekjoon | 7d858d557dbbde6603fe4e8af2891c2b0e1940c0 | [
"MIT"
] | 11 | 2020-09-20T15:17:11.000Z | 2022-03-17T12:43:33.000Z | src/14/14682.py | youngdaLee/Baekjoon | 7d858d557dbbde6603fe4e8af2891c2b0e1940c0 | [
"MIT"
] | 3 | 2021-10-30T07:51:36.000Z | 2022-03-09T05:19:23.000Z | src/14/14682.py | youngdaLee/Baekjoon | 7d858d557dbbde6603fe4e8af2891c2b0e1940c0 | [
"MIT"
] | 13 | 2021-01-21T03:19:08.000Z | 2022-03-28T10:44:58.000Z | """
14682. Shifty Sum
작성자: xCrypt0r
언어: Python 3
사용 메모리: 29,380 KB
소요 시간: 60 ms
해결 날짜: 2020년 9월 20일
"""
def main():
N, k = [int(input()) for _ in range(2)]
res = N
for _ in range(k):
N *= 10
res += N
print(res)
if __name__ == '__main__':
main() | 12.954545 | 43 | 0.526316 |
def main():
N, k = [int(input()) for _ in range(2)]
res = N
for _ in range(k):
N *= 10
res += N
print(res)
if __name__ == '__main__':
main() | true | true |
f709a967b1234667309531a39b0693c8f8ce9bc0 | 5,348 | py | Python | sarpy/io/general/nitf_elements/graphics.py | pressler-vsc/sarpy | fa6c951c42b9a7d9df2edfa53c771494cb0246fb | [
"MIT"
] | 1 | 2021-02-04T08:44:18.000Z | 2021-02-04T08:44:18.000Z | sarpy/io/general/nitf_elements/graphics.py | pressler-vsc/sarpy | fa6c951c42b9a7d9df2edfa53c771494cb0246fb | [
"MIT"
] | null | null | null | sarpy/io/general/nitf_elements/graphics.py | pressler-vsc/sarpy | fa6c951c42b9a7d9df2edfa53c771494cb0246fb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The graphics header element definition.
"""
from .base import NITFElement, UserHeaderType, _IntegerDescriptor,\
_StringDescriptor, _StringEnumDescriptor, _NITFElementDescriptor
from .security import NITFSecurityTags
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
... | 56.294737 | 117 | 0.631077 |
from .base import NITFElement, UserHeaderType, _IntegerDescriptor,\
_StringDescriptor, _StringEnumDescriptor, _NITFElementDescriptor
from .security import NITFSecurityTags
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class GraphicsSegmentHeader(NITFElement):
_ordering = (
'S... | true | true |
f709a9ab548efdde5cce699085047d8dc56830d2 | 7,366 | py | Python | pyrseas/dbobject/column.py | andreypopp/Pyrseas | 5fadc91bfd1e3e430e8f53d434df18b9abea3cb0 | [
"BSD-3-Clause"
] | 1 | 2015-03-16T09:10:47.000Z | 2015-03-16T09:10:47.000Z | pyrseas/dbobject/column.py | andreypopp/Pyrseas | 5fadc91bfd1e3e430e8f53d434df18b9abea3cb0 | [
"BSD-3-Clause"
] | null | null | null | pyrseas/dbobject/column.py | andreypopp/Pyrseas | 5fadc91bfd1e3e430e8f53d434df18b9abea3cb0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pyrseas.column
~~~~~~~~~~~~~~
This module defines two classes: Column derived from
DbSchemaObject and ColumnDict derived from DbObjectDict.
"""
from pyrseas.dbobject import DbObjectDict, DbSchemaObject, quote_id
class Column(DbSchemaObject):
"A table column definition"... | 36.83 | 79 | 0.562449 |
from pyrseas.dbobject import DbObjectDict, DbSchemaObject, quote_id
class Column(DbSchemaObject):
keylist = ['schema', 'table']
def to_map(self):
if hasattr(self, 'dropped'):
return None
dct = self._base_map()
del dct['number'], dct['name'], dct['_table']
if hasa... | true | true |
f709aa2bed50b695798989b4ab08357aee9cbc57 | 47,691 | py | Python | tests/python/relay/test_op_level3.py | whn09/incubator-tvm | 657a6fa6554cc8402eca225f80e1b2cc2803c71a | [
"Apache-2.0"
] | null | null | null | tests/python/relay/test_op_level3.py | whn09/incubator-tvm | 657a6fa6554cc8402eca225f80e1b2cc2803c71a | [
"Apache-2.0"
] | null | null | null | tests/python/relay/test_op_level3.py | whn09/incubator-tvm | 657a6fa6554cc8402eca225f80e1b2cc2803c71a | [
"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... | 42.204425 | 125 | 0.576461 |
import numpy as np
import pytest
import tvm
from tvm import te
from tvm import relay
from tvm.error import TVMError
from tvm.relay import create_executor, transform
from tvm.relay.testing import check_grad, run_infer_type
import tvm.testing
def test_zeros_ones():
for op, ref in [(relay.zeros, np.z... | true | true |
f709aaa7ef848d9eea57b70c4b2699c9584e9ab3 | 2,111 | py | Python | application/pages/training_analysis/services/fit_file_services.py | Jhsmit/awesome-panel | 53f7754f7c505a2666f6724df26c851ae942ec40 | [
"Apache-2.0"
] | 1 | 2020-05-08T21:44:37.000Z | 2020-05-08T21:44:37.000Z | application/pages/training_analysis/services/fit_file_services.py | Jhsmit/awesome-panel | 53f7754f7c505a2666f6724df26c851ae942ec40 | [
"Apache-2.0"
] | null | null | null | application/pages/training_analysis/services/fit_file_services.py | Jhsmit/awesome-panel | 53f7754f7c505a2666f6724df26c851ae942ec40 | [
"Apache-2.0"
] | null | null | null | """In this module we provide services for working with fit files.
Resources
- fitparse package: [GitHub](https://github.com/dtcooper/python-fitparse) and \
[Docs](http://dtcooper.github.io/python-fitparse/)
- fitdecode pacakge: [GitHub](https://github.com/polyvertex/fitdecode) and \
[Read the Docs](htt... | 35.183333 | 93 | 0.650403 |
from typing import Union
import fitparse
import pandas as pd
UNIT_CONVERSION = {
"speed": {"from": "10*6m/s", "to": "km/h", "factor": 0.0036,},
"enhanced_speed": {"from": "10*6m/s", "to": "km/h", "factor": 3.6,},
"altitude": {"from": "unknown", "to": "m", "factor": 0.03855343881175331,},
"p... | true | true |
f709abae3ce3540aa543e1f247ef2b414093609a | 679 | py | Python | hackerrank/Python/Exceptions/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerrank/Python/Exceptions/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerrank/Python/Exceptions/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | import io
import unittest
from contextlib import redirect_stdout
from unittest.mock import patch
class TestQ(unittest.TestCase):
@patch('builtins.input', side_effect=[
'3',
'1 0',
'2 $',
'3 1',
])
def test_case_0(self, input_mock=None):
text_trap = io.StringIO()
... | 26.115385 | 86 | 0.561119 | import io
import unittest
from contextlib import redirect_stdout
from unittest.mock import patch
class TestQ(unittest.TestCase):
@patch('builtins.input', side_effect=[
'3',
'1 0',
'2 $',
'3 1',
])
def test_case_0(self, input_mock=None):
text_trap = io.StringIO()
... | true | true |
f709ac008c4373082aa0f1b4e12d73b060e3e98e | 14,590 | py | Python | RecoEgamma/EgammaTools/python/regressionModifier_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | RecoEgamma/EgammaTools/python/regressionModifier_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | RecoEgamma/EgammaTools/python/regressionModifier_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | import FWCore.ParameterSet.Config as cms
regressionModifier106XUL = cms.PSet(
modifierName = cms.string('EGRegressionModifierV3'),
rhoTag = cms.InputTag('fixedGridRhoFastjetAllTmp'),
useClosestToCentreSeedCrysDef = cms.bool(False),
maxRawEnergyForLowPtEBSigma = cms.double(-1),
maxRawEnergyF... | 58.12749 | 204 | 0.62111 | import FWCore.ParameterSet.Config as cms
regressionModifier106XUL = cms.PSet(
modifierName = cms.string('EGRegressionModifierV3'),
rhoTag = cms.InputTag('fixedGridRhoFastjetAllTmp'),
useClosestToCentreSeedCrysDef = cms.bool(False),
maxRawEnergyForLowPtEBSigma = cms.double(-1),
maxRawEnergyF... | true | true |
f709acd7de0d69fa46a1ab2426b894f47946597c | 15,795 | py | Python | tensorflow/python/kernel_tests/sparse_xent_op_test.py | rainwoodman/tensorflow | 9b7ff60faa841f0473facf618cb5b66b9cb99b5e | [
"Apache-2.0"
] | 3 | 2021-03-15T05:31:57.000Z | 2021-12-14T07:29:31.000Z | tensorflow/python/kernel_tests/sparse_xent_op_test.py | rainwoodman/tensorflow | 9b7ff60faa841f0473facf618cb5b66b9cb99b5e | [
"Apache-2.0"
] | 7 | 2021-11-10T20:21:23.000Z | 2022-03-22T19:18:39.000Z | tensorflow/python/kernel_tests/sparse_xent_op_test.py | rainwoodman/tensorflow | 9b7ff60faa841f0473facf618cb5b66b9cb99b5e | [
"Apache-2.0"
] | 1 | 2019-09-27T09:03:41.000Z | 2019-09-27T09:03:41.000Z | # 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... | 39.68593 | 80 | 0.650839 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import time
import numpy as np
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.client import session
from tensorflow.python.eager import backprop as backprop_l... | true | true |
f709ad2a894c733b34890663a08ccf16a64e97a4 | 7,047 | py | Python | chirp/library/do_delete_audio_file_from_db_test.py | chirpradio/chirpradio-machine | e854db2be43a4c879bbda134272a73225d7fa2df | [
"Apache-2.0"
] | 8 | 2015-03-06T17:28:36.000Z | 2020-11-27T10:06:40.000Z | chirp/library/do_delete_audio_file_from_db_test.py | chirpradio/chirpradio-machine | e854db2be43a4c879bbda134272a73225d7fa2df | [
"Apache-2.0"
] | 9 | 2015-09-21T18:52:22.000Z | 2018-02-12T19:23:17.000Z | chirp/library/do_delete_audio_file_from_db_test.py | chirpradio/chirpradio-machine | e854db2be43a4c879bbda134272a73225d7fa2df | [
"Apache-2.0"
] | 9 | 2016-04-08T00:21:15.000Z | 2018-01-25T19:35:58.000Z | import os
import time
import unittest
from mock import patch
from chirp.library import audio_file_test
from chirp.library import do_delete_audio_file_from_db
from chirp.library import database
TEST_DB_NAME_PATTERN = "/tmp/chirp-library-db_test.%d.sqlite"
class DeleteFingerprintTest(unittest.TestCase):
def set... | 30.506494 | 77 | 0.65276 | import os
import time
import unittest
from mock import patch
from chirp.library import audio_file_test
from chirp.library import do_delete_audio_file_from_db
from chirp.library import database
TEST_DB_NAME_PATTERN = "/tmp/chirp-library-db_test.%d.sqlite"
class DeleteFingerprintTest(unittest.TestCase):
def set... | true | true |
f709ad6bc723b406239f8b4084411aa1356e16f3 | 1,133 | py | Python | setup.py | pjdelport/pytest-testmon | dbbaf2f29cc7e9a2745f27dae91e44ce973e8d10 | [
"MIT"
] | null | null | null | setup.py | pjdelport/pytest-testmon | dbbaf2f29cc7e9a2745f27dae91e44ce973e8d10 | [
"MIT"
] | null | null | null | setup.py | pjdelport/pytest-testmon | dbbaf2f29cc7e9a2745f27dae91e44ce973e8d10 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='pytest-testmon',
description='take TDD to a new level with py.test and testmon',
long_description=''.join(open('README.rst').readlines()),
version='0.9.15',
license='MIT',
platforms=['linux', 'osx', 'win32'],
packages=['testmon'],
url='https://g... | 33.323529 | 70 | 0.58782 | from setuptools import setup
setup(
name='pytest-testmon',
description='take TDD to a new level with py.test and testmon',
long_description=''.join(open('README.rst').readlines()),
version='0.9.15',
license='MIT',
platforms=['linux', 'osx', 'win32'],
packages=['testmon'],
url='https://g... | true | true |
f709ae4ed5324f7f1cb8132611e387bb13a68a6f | 2,557 | py | Python | tests/test_imports.py | mnicolas94/pyrulo | 1a537369407b760182bd40f188fd82be637310e2 | [
"MIT"
] | null | null | null | tests/test_imports.py | mnicolas94/pyrulo | 1a537369407b760182bd40f188fd82be637310e2 | [
"MIT"
] | null | null | null | tests/test_imports.py | mnicolas94/pyrulo | 1a537369407b760182bd40f188fd82be637310e2 | [
"MIT"
] | null | null | null | import unittest
import pyrulo.class_imports
class TestImports(unittest.TestCase):
def setUp(self) -> None:
pass
def tearDown(self) -> None:
pass
def test_whenImportClassesByDir_resultIsTheExpected(self):
# arrange
path = "test_classes"
# act
classes = p... | 27.793478 | 91 | 0.637857 | import unittest
import pyrulo.class_imports
class TestImports(unittest.TestCase):
def setUp(self) -> None:
pass
def tearDown(self) -> None:
pass
def test_whenImportClassesByDir_resultIsTheExpected(self):
path = "test_classes"
classes = pyrulo.class_im... | true | true |
f709b0dedd5c969d909177a66ee08e53365ca5a2 | 1,357 | py | Python | test/test_settings.py | mm40/pudb | 889016708fccdcb27b6cbe03b94d626f6d39be46 | [
"MIT"
] | 3 | 2015-12-23T06:45:52.000Z | 2017-03-14T10:04:44.000Z | test/test_settings.py | mm40/pudb | 889016708fccdcb27b6cbe03b94d626f6d39be46 | [
"MIT"
] | null | null | null | test/test_settings.py | mm40/pudb | 889016708fccdcb27b6cbe03b94d626f6d39be46 | [
"MIT"
] | 3 | 2015-08-10T17:41:14.000Z | 2020-03-03T10:13:47.000Z | import collections
import pytest # noqa: F401
from pudb.py3compat import builtins
from pudb.settings import load_breakpoints, save_breakpoints
def test_load_breakpoints(mocker):
fake_data = ["b /home/user/test.py:41"], ["b /home/user/test.py:50"]
mock_open = mocker.mock_open()
mock_open.return_value.re... | 38.771429 | 72 | 0.692704 | import collections
import pytest
from pudb.py3compat import builtins
from pudb.settings import load_breakpoints, save_breakpoints
def test_load_breakpoints(mocker):
fake_data = ["b /home/user/test.py:41"], ["b /home/user/test.py:50"]
mock_open = mocker.mock_open()
mock_open.return_value.readlines.side... | true | true |
f709b235057889c4af135a5edda5c8d0cda7c681 | 10,703 | py | Python | tests/unit/Containers.py | rashmi43/platform-engine | dd9a22742bc8dc43a530ea5edef39b3c35db57c1 | [
"Apache-2.0"
] | null | null | null | tests/unit/Containers.py | rashmi43/platform-engine | dd9a22742bc8dc43a530ea5edef39b3c35db57c1 | [
"Apache-2.0"
] | null | null | null | tests/unit/Containers.py | rashmi43/platform-engine | dd9a22742bc8dc43a530ea5edef39b3c35db57c1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import hashlib
from unittest.mock import MagicMock
from asyncy.AppConfig import Expose
from asyncy.Containers import Containers
from asyncy.Exceptions import ActionNotFound, ContainerSpecNotRegisteredError,\
EnvironmentVariableNotFound, K8sError
from asyncy.Kubernetes import Kubernetes
from... | 33.136223 | 79 | 0.624872 |
import hashlib
from unittest.mock import MagicMock
from asyncy.AppConfig import Expose
from asyncy.Containers import Containers
from asyncy.Exceptions import ActionNotFound, ContainerSpecNotRegisteredError,\
EnvironmentVariableNotFound, K8sError
from asyncy.Kubernetes import Kubernetes
from asyncy.constants.LineC... | true | true |
f709b2e65336b023bfdac6a056b5c4f86ebed150 | 1,327 | py | Python | yepes/fields/postal_code.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | yepes/fields/postal_code.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | yepes/fields/postal_code.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from yepes import forms
from yepes.fields.char import CharField
from yepes.validators import PostalCodeValidator
from yepes.utils.deconstruct import clean_keywords
class PostalCodeField(CharField)... | 30.860465 | 77 | 0.660889 |
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from yepes import forms
from yepes.fields.char import CharField
from yepes.validators import PostalCodeValidator
from yepes.utils.deconstruct import clean_keywords
class PostalCodeField(CharField):
default_validat... | true | true |
f709b3b126143357e20c2bcb075dff3ce91691c4 | 4,078 | py | Python | pymodel/TestSuite.py | Python3pkg/PyModel | e0d404e122202c25c85dcebedcbd567837068b65 | [
"BSD-3-Clause"
] | 3 | 2017-06-09T22:45:16.000Z | 2021-02-13T23:18:44.000Z | pymodel/TestSuite.py | Python3pkg/PyModel | e0d404e122202c25c85dcebedcbd567837068b65 | [
"BSD-3-Clause"
] | null | null | null | pymodel/TestSuite.py | Python3pkg/PyModel | e0d404e122202c25c85dcebedcbd567837068b65 | [
"BSD-3-Clause"
] | null | null | null | """
Interface to a test suite module (one or more runs) used by ProductModelProgram
"""
from operator import concat
from .model import Model
from functools import reduce
class TestSuite(Model):
def __init__(self, module, exclude, include):
Model.__init__(self, module, exclude, include)
def post_init(self):
... | 34.268908 | 79 | 0.660128 |
from operator import concat
from .model import Model
from functools import reduce
class TestSuite(Model):
def __init__(self, module, exclude, include):
Model.__init__(self, module, exclude, include)
def post_init(self):
if hasattr(self.module, 'testsuite'):
self.module.testSuite = ... | true | true |
f709b422a4a86fca2bfa9d6d75f29ff165ea07aa | 2,764 | py | Python | eth/vm/forks/byzantium/__init__.py | dylanjw/py-evm | c78020fe0cf6b4d98b93264872dfd10c59757e06 | [
"MIT"
] | 5 | 2018-09-28T20:01:42.000Z | 2022-02-22T19:54:46.000Z | env/lib/python3.7/site-packages/eth/vm/forks/byzantium/__init__.py | kpeluso/vyper-dynamic-array | fb18070650c6fafeca9d3ab99d667147a4b3acc4 | [
"MIT"
] | null | null | null | env/lib/python3.7/site-packages/eth/vm/forks/byzantium/__init__.py | kpeluso/vyper-dynamic-array | fb18070650c6fafeca9d3ab99d667147a4b3acc4 | [
"MIT"
] | 1 | 2019-02-27T21:29:16.000Z | 2019-02-27T21:29:16.000Z | from typing import ( # noqa: F401
Type,
)
from cytoolz import (
curry,
)
from eth_utils import (
encode_hex,
ValidationError,
)
from eth.constants import (
MAX_UNCLE_DEPTH,
)
from eth.rlp.blocks import BaseBlock # noqa: F401
from eth.rlp.receipts import Receipt
from eth.validation import (
... | 29.094737 | 90 | 0.736614 | from typing import (
Type,
)
from cytoolz import (
curry,
)
from eth_utils import (
encode_hex,
ValidationError,
)
from eth.constants import (
MAX_UNCLE_DEPTH,
)
from eth.rlp.blocks import BaseBlock
from eth.rlp.receipts import Receipt
from eth.validation import (
validate_lte,
)
from eth... | true | true |
f709b5200ed53cfbc4b378054a4d8839207369cc | 740 | py | Python | setup.py | 29next/next-theme-kit | 8abe7234c0fcf8af6004385ee28d9fb29bcaef9c | [
"MIT"
] | 7 | 2021-05-26T11:57:20.000Z | 2021-06-13T09:57:46.000Z | setup.py | 29next/next-theme-kit | 8abe7234c0fcf8af6004385ee28d9fb29bcaef9c | [
"MIT"
] | 1 | 2021-05-25T00:11:16.000Z | 2021-05-25T02:18:56.000Z | setup.py | 29next/theme-kit | 8abe7234c0fcf8af6004385ee28d9fb29bcaef9c | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
__version__ = '1.0.1'
tests_require = [
"flake8==3.9.2",
"nose==1.3.7"
]
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(
name='next-theme-kit',
author="29next",
author_email="dev@29next.com",
url='https://github.com/29ne... | 20.555556 | 50 | 0.590541 | from setuptools import find_packages, setup
__version__ = '1.0.1'
tests_require = [
"flake8==3.9.2",
"nose==1.3.7"
]
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(
name='next-theme-kit',
author="29next",
author_email="dev@29next.com",
url='https://github.com/29ne... | true | true |
f709b5d4d2e798dbd11856e6f3b5f1768f57e8b8 | 6,050 | py | Python | tests/test_parser.py | dbrattli/Expression | 1cf04ccd5d5e277baea7113c3b420a85f22712b5 | [
"MIT"
] | 22 | 2020-11-03T03:17:12.000Z | 2020-11-28T07:02:38.000Z | tests/test_parser.py | dbrattli/Expression | 1cf04ccd5d5e277baea7113c3b420a85f22712b5 | [
"MIT"
] | null | null | null | tests/test_parser.py | dbrattli/Expression | 1cf04ccd5d5e277baea7113c3b420a85f22712b5 | [
"MIT"
] | 1 | 2020-11-08T13:24:32.000Z | 2020-11-08T13:24:32.000Z | from __future__ import annotations
import string
from dataclasses import dataclass
from typing import Any, Tuple
from expression import Error, Nothing, Ok, Option, Some, TaggedUnion, match, pipe, tag
from expression.collections import Block
from expression.extra.parser import (
Parser,
and_then,
any_of,
... | 22.242647 | 86 | 0.561322 | from __future__ import annotations
import string
from dataclasses import dataclass
from typing import Any, Tuple
from expression import Error, Nothing, Ok, Option, Some, TaggedUnion, match, pipe, tag
from expression.collections import Block
from expression.extra.parser import (
Parser,
and_then,
any_of,
... | true | true |
f709b65418dc777da8e49db95809cebc85771242 | 400 | py | Python | 2017-08-23/exemplo_servidor_django/meuprojeto/petshop/migrations/0003_animal_dono.py | dunossauro/bora_falar_de_python | 7fe92d6257a2cad1c570255bc9be069f6c8e38d3 | [
"Apache-2.0"
] | 6 | 2017-09-07T20:24:48.000Z | 2018-09-12T16:16:32.000Z | 2017-08-23/exemplo_servidor_django/meuprojeto/petshop/migrations/0003_animal_dono.py | dunossauro/bora_falar_de_python | 7fe92d6257a2cad1c570255bc9be069f6c8e38d3 | [
"Apache-2.0"
] | 1 | 2017-12-22T01:47:12.000Z | 2017-12-24T13:59:13.000Z | 2017-08-23/exemplo_servidor_django/meuprojeto/petshop/migrations/0003_animal_dono.py | dunossauro/bora_falar_de_python | 7fe92d6257a2cad1c570255bc9be069f6c8e38d3 | [
"Apache-2.0"
] | 6 | 2017-10-20T01:25:01.000Z | 2018-09-11T22:54:01.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('petshop', '0002_dono'),
]
operations = [
migrations.AddField(
model_name='animal',
name='dono',
... | 20 | 66 | 0.5875 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('petshop', '0002_dono'),
]
operations = [
migrations.AddField(
model_name='animal',
name='dono',
field=models.Fo... | true | true |
f709b6ad81d25a0c074deaa1308cf04158654f02 | 1,373 | py | Python | tests/book/ch05/classify_name.py | TITC/pyhanlp | ad062f358805da5bf97f78d9f37f441c06ae4d19 | [
"Apache-2.0"
] | null | null | null | tests/book/ch05/classify_name.py | TITC/pyhanlp | ad062f358805da5bf97f78d9f37f441c06ae4d19 | [
"Apache-2.0"
] | null | null | null | tests/book/ch05/classify_name.py | TITC/pyhanlp | ad062f358805da5bf97f78d9f37f441c06ae4d19 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# Author:hankcs
# Date: 2018-06-21 19:46
# 《自然语言处理入门》5.3 基于感知机的人名性别分类
# 配套书籍:http://nlp.hankcs.com/book.php
# 讨论答疑:https://bbs.hankcs.com/
import sys,os# environment, adjust the priority
sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))... | 38.138889 | 112 | 0.718864 |
import sys,os
sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
from pyhanlp import *
from tests.test_utility import ensure_data
PerceptronNameGenderClassifier = JClass('com.hankcs.hanlp.model.perceptron.PerceptronNameGenderClassifier')
cnname = ens... | true | true |
f709b7b4e48264871c1d14816252623fa84ae826 | 579 | py | Python | pepdb/core/migrations/0143_auto_20180403_1255.py | dchaplinsky/pep.org.ua | 8633a65fb657d7f04dbdb12eb8ae705fa6be67e3 | [
"MIT"
] | 7 | 2015-12-21T03:52:46.000Z | 2020-07-24T19:17:23.000Z | pepdb/core/migrations/0143_auto_20180403_1255.py | dchaplinsky/pep.org.ua | 8633a65fb657d7f04dbdb12eb8ae705fa6be67e3 | [
"MIT"
] | 12 | 2016-03-05T18:11:05.000Z | 2021-06-17T20:20:03.000Z | pepdb/core/migrations/0143_auto_20180403_1255.py | dchaplinsky/pep.org.ua | 8633a65fb657d7f04dbdb12eb8ae705fa6be67e3 | [
"MIT"
] | 4 | 2016-07-17T20:19:38.000Z | 2021-03-23T12:47:20.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-04-03 09:55
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0142_auto_20180301_2143'),
]
operations =... | 26.318182 | 142 | 0.661485 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0142_auto_20180301_2143'),
]
operations = [
migrations.AlterField(
model_name='declaration',
... | true | true |
f709b7e141af88e2c6bddfcf36ef2b4d97d0b978 | 4,567 | py | Python | app/hrcm/classes/candidate.py | bastienbot/hr-challenges-manager | 1fe8e4fa34f6866a724c2461bc17cc442fe50a4c | [
"MIT"
] | null | null | null | app/hrcm/classes/candidate.py | bastienbot/hr-challenges-manager | 1fe8e4fa34f6866a724c2461bc17cc442fe50a4c | [
"MIT"
] | null | null | null | app/hrcm/classes/candidate.py | bastienbot/hr-challenges-manager | 1fe8e4fa34f6866a724c2461bc17cc442fe50a4c | [
"MIT"
] | null | null | null | import os
import json
from datetime import datetime
from .challenge import Challenge
from hrcm.services.db import DBConnector
from hrcm.errors.bad_request import BadRequest
from hrcm.helpers import format_username, format_message
class Candidate:
"""
@desc We prepare all the instance parameters along side th... | 31.496552 | 101 | 0.640245 | import os
import json
from datetime import datetime
from .challenge import Challenge
from hrcm.services.db import DBConnector
from hrcm.errors.bad_request import BadRequest
from hrcm.helpers import format_username, format_message
class Candidate:
def __init__(self, informations):
self._id = informations.... | true | true |
f709b80e5f1c7707c4509530ecca4a245f8ec708 | 3,847 | py | Python | tests/PySys/environments/environment_c8y.py | PradeepKiruvale/localworkflow | b5f3c97c835cb36ae87f14b8697bedcca5d22619 | [
"Apache-2.0"
] | 6 | 2021-09-14T10:14:15.000Z | 2021-11-20T13:42:26.000Z | tests/PySys/environments/environment_c8y.py | PradeepKiruvale/localworkflow | b5f3c97c835cb36ae87f14b8697bedcca5d22619 | [
"Apache-2.0"
] | null | null | null | tests/PySys/environments/environment_c8y.py | PradeepKiruvale/localworkflow | b5f3c97c835cb36ae87f14b8697bedcca5d22619 | [
"Apache-2.0"
] | null | null | null | import base64
import json
import re
import requests
import psutil
from pysys.basetest import BaseTest
from pysys.constants import FAILED
from cumulocity import Cumulocity
from environment_tedge import TedgeEnvironment
"""
Environment to manage automated connects and disconnects to c8y
"""
class EnvironmentC8y(Ted... | 29.592308 | 95 | 0.593709 | import base64
import json
import re
import requests
import psutil
from pysys.basetest import BaseTest
from pysys.constants import FAILED
from cumulocity import Cumulocity
from environment_tedge import TedgeEnvironment
class EnvironmentC8y(TedgeEnvironment):
cumulocity: Cumulocity
def setup(self):
... | true | true |
f709b828175fdc3722692be33dce392102dcbe34 | 416 | py | Python | examples/compile-only.p4app/main.py | serhatarslan-hub/p4app | 6ac7e769ee2e73382c32c96dfff8729e46b51431 | [
"Apache-2.0"
] | null | null | null | examples/compile-only.p4app/main.py | serhatarslan-hub/p4app | 6ac7e769ee2e73382c32c96dfff8729e46b51431 | [
"Apache-2.0"
] | null | null | null | examples/compile-only.p4app/main.py | serhatarslan-hub/p4app | 6ac7e769ee2e73382c32c96dfff8729e46b51431 | [
"Apache-2.0"
] | 2 | 2021-05-19T16:36:42.000Z | 2021-11-01T21:35:51.000Z | from p4app import P4Program
import json
# Compile a P4_16 program:
prog16 = P4Program('wire.p4')
prog16.compile()
# Inspect the compiled JSON file
with open(prog16.json(), 'r') as f:
bmv2_json = json.load(f)
#print bmv2_json['actions']
# Compile a P4_14 program:
prog14 = P4Program('wire14.p4', version=14)
p... | 18.086957 | 43 | 0.689904 | from p4app import P4Program
import json
prog16 = P4Program('wire.p4')
prog16.compile()
with open(prog16.json(), 'r') as f:
bmv2_json = json.load(f)
prog14 = P4Program('wire14.p4', version=14)
prog14.compile()
with open(prog14.json(), 'r') as f:
bmv2_json = json.load(f)
print("OK")
| true | true |
f709b82b33a33885a4357d82d763d405a1fc0a14 | 4,267 | py | Python | pyretrace/reader.py | probablyodd/pyretrace | a65f456597514e8a845ff4ad50deeca1acc13245 | [
"BSD-2-Clause-FreeBSD"
] | 20 | 2015-10-27T08:17:32.000Z | 2022-03-13T09:43:30.000Z | pyretrace/reader.py | probablyodd/pyretrace | a65f456597514e8a845ff4ad50deeca1acc13245 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | pyretrace/reader.py | probablyodd/pyretrace | a65f456597514e8a845ff4ad50deeca1acc13245 | [
"BSD-2-Clause-FreeBSD"
] | 8 | 2015-12-28T18:52:09.000Z | 2021-01-06T10:13:35.000Z | from __future__ import print_function
import sys
class MappingReader():
def __init__(self, mapping_file):
self.mapping_file = mapping_file
def pump(self, mapping_processor):
reader = open(self.mapping_file, 'r')
try:
class_name = None
# Read the subsequent ... | 37.429825 | 102 | 0.542536 | from __future__ import print_function
import sys
class MappingReader():
def __init__(self, mapping_file):
self.mapping_file = mapping_file
def pump(self, mapping_processor):
reader = open(self.mapping_file, 'r')
try:
class_name = None
while Tru... | true | true |
f709b83b7dd0d4dc8f2ed9be76428c1683165b7d | 1,895 | py | Python | luafun/game/config.py | Delaunay/LuaFun | bd0efd8fc2b064d6bf58993e59a6ad4ac6713b39 | [
"BSD-3-Clause"
] | 1 | 2021-02-06T06:42:29.000Z | 2021-02-06T06:42:29.000Z | luafun/game/config.py | Delaunay/LuaFun | bd0efd8fc2b064d6bf58993e59a6ad4ac6713b39 | [
"BSD-3-Clause"
] | 6 | 2021-04-08T21:46:06.000Z | 2021-05-09T01:40:04.000Z | luafun/game/config.py | Delaunay/LuaFun | bd0efd8fc2b064d6bf58993e59a6ad4ac6713b39 | [
"BSD-3-Clause"
] | null | null | null | import os
EXECUTABLE_PATH_WINDOWS = '/game/bin/win64/dota2.exe'
EXECUTABLE_PATH_LINUX = '/game/dota.sh'
EXECUTABLE_PATH_LINUX = '/game/bin/linuxsteamrt64/dota2'
BOT_PATH = '/game/dota/scripts/vscripts/bots/'
CONSOLE_LOG = '/game/dota/scripts/vscripts/bots/console.log'
SEND_MSG = '/game/dota/scripts/vscripts/bots/IPC_... | 28.712121 | 81 | 0.667018 | import os
EXECUTABLE_PATH_WINDOWS = '/game/bin/win64/dota2.exe'
EXECUTABLE_PATH_LINUX = '/game/dota.sh'
EXECUTABLE_PATH_LINUX = '/game/bin/linuxsteamrt64/dota2'
BOT_PATH = '/game/dota/scripts/vscripts/bots/'
CONSOLE_LOG = '/game/dota/scripts/vscripts/bots/console.log'
SEND_MSG = '/game/dota/scripts/vscripts/bots/IPC_... | true | true |
f709b94b5dc3cc9000a3be6044866aa2ad321e0c | 1,671 | py | Python | emet/hypothesis/generate_dictionary.py | stephanefschwarz/EMET | 92ab8b0a53bbdfe5618353f0055eba98ae93f53f | [
"MIT"
] | 3 | 2020-05-19T19:45:06.000Z | 2021-03-21T03:59:19.000Z | emet/hypothesis/generate_dictionary.py | stephanefschwarz/EMET | 92ab8b0a53bbdfe5618353f0055eba98ae93f53f | [
"MIT"
] | null | null | null | emet/hypothesis/generate_dictionary.py | stephanefschwarz/EMET | 92ab8b0a53bbdfe5618353f0055eba98ae93f53f | [
"MIT"
] | 2 | 2021-03-21T04:36:58.000Z | 2022-01-31T07:29:49.000Z | import sys
import pandas as pd
import requests
import nltk
nltk.download('stopwords')
from nltk.tokenize import RegexpTokenizer
from nltk.corpus import stopwords
from bs4 import BeautifulSoup
# --- open dataset --- #
data = pd.read_csv('./dataset/translated_twitter_posts.csv')
documents = data['translated_posts']
#... | 28.810345 | 105 | 0.617594 | import sys
import pandas as pd
import requests
import nltk
nltk.download('stopwords')
from nltk.tokenize import RegexpTokenizer
from nltk.corpus import stopwords
from bs4 import BeautifulSoup
data = pd.read_csv('./dataset/translated_twitter_posts.csv')
documents = data['translated_posts']
premises = []
tokenizer ... | true | true |
f709b9bf5ba6566862a18830554448f31ea2f564 | 20,398 | py | Python | hs_labels/models.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_labels/models.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_labels/models.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | """
This model supports user labeling of resources in various ways.
For a User u, this instantiates a subobject u.ulabels (like u.uaccess)
that contains all the labeling functions.
Functions include:
* u.ulabels.label_resource(r, label)
instantiates a label for a resource. Resources can have multiple labels.
... | 38.779468 | 110 | 0.595402 |
import re
from django.contrib.auth.models import User
from django.db import models
from django.db import transaction
from django.db.models import Q
from hs_core.models import BaseResource
class FlagCodes(object):
FAVORITE = 1
MINE = 2
OPEN_WITH_APP = 3
FLAG_CHOICES = (
(FAVORITE, 'Favorite'... | true | true |
f709ba30f2ddb928e1e17aeebb2ecdb73dfac7e8 | 5,549 | py | Python | official/nlp/bert/run_squad.py | gujralsanyam22/models | d96f8f043dbe2b5ca8ea1785f57df8faf68d8875 | [
"Apache-2.0"
] | 2 | 2020-12-11T04:07:55.000Z | 2020-12-11T04:08:11.000Z | official/nlp/bert/run_squad.py | gujralsanyam22/models | d96f8f043dbe2b5ca8ea1785f57df8faf68d8875 | [
"Apache-2.0"
] | null | null | null | official/nlp/bert/run_squad.py | gujralsanyam22/models | d96f8f043dbe2b5ca8ea1785f57df8faf68d8875 | [
"Apache-2.0"
] | 3 | 2021-02-22T13:24:07.000Z | 2021-02-26T02:06:24.000Z | # Copyright 2019 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... | 36.267974 | 80 | 0.73707 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import time
from absl import app
from absl import flags
from absl import logging
import gin
import tensorflow as tf
from official.common import distribute_utils
from offic... | true | true |
f709ba80071c7ed33b34ab298cb31c2a7898803c | 2,292 | py | Python | mininet_topology/Topo10hosts&router/Topo10.py | medic0803/Ginkgo-RnD-Project-Floodlight | 4cac7a7152ec49be93a6e42dcb3c3bf614546e9a | [
"Apache-2.0"
] | 3 | 2021-01-11T11:08:09.000Z | 2021-03-28T01:02:50.000Z | mininet_topology/Topo10hosts&router/Topo10.py | medic0803/Ginkgo-RnD-Project-Floodlight | 4cac7a7152ec49be93a6e42dcb3c3bf614546e9a | [
"Apache-2.0"
] | 10 | 2020-12-25T10:30:25.000Z | 2021-05-17T13:09:32.000Z | mininet_topology/Topo10hosts&router/Topo10.py | medic0803/Ginkgo-RnD-Project-Floodlight | 4cac7a7152ec49be93a6e42dcb3c3bf614546e9a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
from mininet.node import CPULimitedHost, Host, Node
from mininet.node import OVSKernelSwitch, UserSwitch
from mininet.node import IVSSwitch
from mininet.cli import CLI
from mininet.log import setLogL... | 27.614458 | 117 | 0.637871 |
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
from mininet.node import CPULimitedHost, Host, Node
from mininet.node import OVSKernelSwitch, UserSwitch
from mininet.node import IVSSwitch
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from m... | true | true |
f709bae64888c279d680e86fbedd96c227f6f4d8 | 9,085 | py | Python | plaidrl/torch/smac/launcher.py | charliec443/plaid-rl | 2e8fbf389af9efecd41361df80e40e0bf932056d | [
"MIT"
] | null | null | null | plaidrl/torch/smac/launcher.py | charliec443/plaid-rl | 2e8fbf389af9efecd41361df80e40e0bf932056d | [
"MIT"
] | null | null | null | plaidrl/torch/smac/launcher.py | charliec443/plaid-rl | 2e8fbf389af9efecd41361df80e40e0bf932056d | [
"MIT"
] | null | null | null | import pickle
import plaidrl.torch.pytorch_util as ptu
from plaidrl.core import logger
from plaidrl.core.meta_rl_algorithm import MetaRLAlgorithm
from plaidrl.core.simple_offline_rl_algorithm import OfflineMetaRLAlgorithm
from plaidrl.data_management.env_replay_buffer import EnvReplayBuffer
from plaidrl.demos.source.m... | 36.633065 | 86 | 0.716346 | import pickle
import plaidrl.torch.pytorch_util as ptu
from plaidrl.core import logger
from plaidrl.core.meta_rl_algorithm import MetaRLAlgorithm
from plaidrl.core.simple_offline_rl_algorithm import OfflineMetaRLAlgorithm
from plaidrl.data_management.env_replay_buffer import EnvReplayBuffer
from plaidrl.demos.source.m... | true | true |
f709bb26c60915265cade2b384fdde8847a123c3 | 1,070 | py | Python | messenger/migrations/0001_initial.py | lucida-no/hdo-quiz-service | 32e03165e8d495f1290edd2b96cc1cba415f9799 | [
"BSD-3-Clause"
] | null | null | null | messenger/migrations/0001_initial.py | lucida-no/hdo-quiz-service | 32e03165e8d495f1290edd2b96cc1cba415f9799 | [
"BSD-3-Clause"
] | 13 | 2017-01-01T23:23:29.000Z | 2017-05-27T11:15:38.000Z | messenger/migrations/0001_initial.py | lucida-no/hdo-messenger-backend | 32e03165e8d495f1290edd2b96cc1cba415f9799 | [
"BSD-3-Clause"
] | 1 | 2017-01-01T16:32:30.000Z | 2017-01-01T16:32:30.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-03-05 13:47
from __future__ import unicode_literals
from django.db import migrations, models
import jsonfield.fields
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.C... | 34.516129 | 151 | 0.614019 |
from __future__ import unicode_literals
from django.db import migrations, models
import jsonfield.fields
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ChatSession',
fields=[
... | true | true |
f709bc9106901d8180f4e8a8ab96e5dcd594d6f5 | 7,740 | py | Python | community/migrations/0001_squashed_0004_auto_20170831_0541.py | ewjoachim/pythondotorg | 382741cc6208fc56aa827cdd1da41983fb7e6ba8 | [
"Apache-2.0"
] | 911 | 2015-01-03T22:16:06.000Z | 2022-03-31T23:56:22.000Z | community/migrations/0001_squashed_0004_auto_20170831_0541.py | ewjoachim/pythondotorg | 382741cc6208fc56aa827cdd1da41983fb7e6ba8 | [
"Apache-2.0"
] | 1,342 | 2015-01-02T16:14:45.000Z | 2022-03-28T08:01:20.000Z | community/migrations/0001_squashed_0004_auto_20170831_0541.py | ewjoachim/pythondotorg | 382741cc6208fc56aa827cdd1da41983fb7e6ba8 | [
"Apache-2.0"
] | 551 | 2015-01-04T02:17:31.000Z | 2022-03-23T11:59:25.000Z | # Generated by Django 1.9.13 on 2017-08-31 05:44
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import markupfield.fields
class Migration(migrations.Migration):
replaces = [('comm... | 59.083969 | 217 | 0.613824 |
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import markupfield.fields
class Migration(migrations.Migration):
replaces = [('community', '0001_initial'), ('community', '0002_aut... | true | true |
f709bea1e2a5cc19ce8c1b6caa6b04ad1d2ec215 | 3,976 | py | Python | test/unit/test_crypto_encryption_decryptor.py | farleyb-amazon/aws-encryption-sdk-python | 7950abd73ee333407d2dadd02ef2d57c3df464cf | [
"Apache-2.0"
] | 95 | 2018-08-20T23:10:00.000Z | 2022-02-17T02:54:32.000Z | test/unit/test_crypto_encryption_decryptor.py | farleyb-amazon/aws-encryption-sdk-python | 7950abd73ee333407d2dadd02ef2d57c3df464cf | [
"Apache-2.0"
] | 220 | 2018-08-01T20:56:29.000Z | 2022-03-28T18:12:35.000Z | test/unit/test_crypto_encryption_decryptor.py | farleyb-amazon/aws-encryption-sdk-python | 7950abd73ee333407d2dadd02ef2d57c3df464cf | [
"Apache-2.0"
] | 63 | 2018-08-01T19:37:33.000Z | 2022-03-20T17:14:15.000Z | # Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 40.161616 | 118 | 0.788229 |
import pytest
from mock import MagicMock, sentinel
from pytest_mock import mocker
import aws_encryption_sdk.internal.crypto.encryption
from aws_encryption_sdk.internal.crypto.encryption import Decryptor, decrypt
pytestmark = [pytest.mark.unit, pytest.mark.local]
@pytest.fixture
def patch_default_backe... | true | true |
f709c1866b436cc5e4023f18c6372832500ce7ae | 67 | py | Python | pm4py/models/transition_system/__init__.py | edugonza/pm4py-source | b5ae5ea40799155d6540692f94be0444c16fd9d3 | [
"Apache-2.0"
] | null | null | null | pm4py/models/transition_system/__init__.py | edugonza/pm4py-source | b5ae5ea40799155d6540692f94be0444c16fd9d3 | [
"Apache-2.0"
] | null | null | null | pm4py/models/transition_system/__init__.py | edugonza/pm4py-source | b5ae5ea40799155d6540692f94be0444c16fd9d3 | [
"Apache-2.0"
] | null | null | null | from pm4py.models.transition_system import transition_system, utils | 67 | 67 | 0.895522 | from pm4py.models.transition_system import transition_system, utils | true | true |
f709c266be7704361d822d91c5e72c7e402bb726 | 5,797 | py | Python | spyder/plugins/editor/utils/debugger.py | seryj/spyder | acea4f501c1a04d57b02e5e817708a69b503f430 | [
"MIT"
] | null | null | null | spyder/plugins/editor/utils/debugger.py | seryj/spyder | acea4f501c1a04d57b02e5e817708a69b503f430 | [
"MIT"
] | null | null | null | spyder/plugins/editor/utils/debugger.py | seryj/spyder | acea4f501c1a04d57b02e5e817708a69b503f430 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Contains the text debugger manager.
"""
import os.path as osp
from qtpy.QtWidgets import QInputDialog, QLineEdit
from spyder.config.main import CONF
from spyder... | 34.921687 | 77 | 0.621701 |
import os.path as osp
from qtpy.QtWidgets import QInputDialog, QLineEdit
from spyder.config.main import CONF
from spyder.config.base import _
from spyder.py3compat import to_text_string
from spyder.api.manager import Manager
from spyder.plugins.editor.utils.editor import BlockUserData
def _load_all_breakpoint... | true | true |
f709c3d8c452141544904aa3206512fef48698f7 | 1,900 | py | Python | openstack/tests/unit/clustering/v1/test_profile_type.py | NeCTAR-RC/openstacksdk | 60a24f6c4717a1f9a0e545c9a07e68afaedc5a27 | [
"Apache-2.0"
] | null | null | null | openstack/tests/unit/clustering/v1/test_profile_type.py | NeCTAR-RC/openstacksdk | 60a24f6c4717a1f9a0e545c9a07e68afaedc5a27 | [
"Apache-2.0"
] | null | null | null | openstack/tests/unit/clustering/v1/test_profile_type.py | NeCTAR-RC/openstacksdk | 60a24f6c4717a1f9a0e545c9a07e68afaedc5a27 | [
"Apache-2.0"
] | 1 | 2020-07-21T02:18:23.000Z | 2020-07-21T02:18:23.000Z | # 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, software
# distributed under t... | 31.666667 | 75 | 0.659474 |
import mock
from openstack.tests.unit import base
from openstack.clustering.v1 import profile_type
FAKE = {
'name': 'FAKE_PROFILE_TYPE',
'schema': {
'foo': 'bar'
},
'support_status': {
'1.0': [{
'status': 'supported',
'since': '2016.10',
}]
... | true | true |
f709c576d0c06e1b8e9c1dba47fe5262c19309d7 | 2,468 | py | Python | examples/test_dump_kws_two_targets.py | sriiora/tcf | e607ce04f97dbb4910d94428c0600a6a7145a825 | [
"Apache-2.0"
] | 24 | 2018-08-21T18:04:48.000Z | 2022-02-07T22:50:06.000Z | examples/test_dump_kws_two_targets.py | sriiora/tcf | e607ce04f97dbb4910d94428c0600a6a7145a825 | [
"Apache-2.0"
] | 16 | 2018-08-21T18:03:52.000Z | 2022-03-01T17:15:42.000Z | examples/test_dump_kws_two_targets.py | sriiora/tcf | e607ce04f97dbb4910d94428c0600a6a7145a825 | [
"Apache-2.0"
] | 29 | 2018-08-22T19:40:59.000Z | 2021-12-21T11:13:23.000Z | #! /usr/bin/python3
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# pylint: disable = missing-docstring
"""Testcase using two targets
--------------------------
Note n this case the target group names are listing two targets and
each target obejct has different values.
.. literali... | 35.257143 | 122 | 0.616288 |
import pprint
import tcfl.tc
@tcfl.tc.target()
@tcfl.tc.target()
@tcfl.tc.tags(build_only = True, ignore_example = True)
class _test(tcfl.tc.tc_c):
def build(self, target, target1):
self.report_info("Keywords for testcase:\n%s"
% pprint.pformat(self.kws),
... | true | true |
f709c6ae72b126c7b0f1d53b851327f9981b2de1 | 29,835 | py | Python | python/pulumi_eks/managed_node_group.py | fitzoh/pulumi-eks | 865ccf14cdf6bec706e443c8fda44f85f388c9e1 | [
"Apache-2.0"
] | 8 | 2018-09-27T21:31:46.000Z | 2018-12-01T02:33:18.000Z | python/pulumi_eks/managed_node_group.py | fitzoh/pulumi-eks | 865ccf14cdf6bec706e443c8fda44f85f388c9e1 | [
"Apache-2.0"
] | 21 | 2018-08-23T16:47:29.000Z | 2018-12-02T03:07:22.000Z | python/pulumi_eks/managed_node_group.py | fitzoh/pulumi-eks | 865ccf14cdf6bec706e443c8fda44f85f388c9e1 | [
"Apache-2.0"
] | 6 | 2018-09-05T16:21:21.000Z | 2018-10-26T23:11:00.000Z | # coding=utf-8
# *** WARNING: this file was generated by pulumi-gen-eks. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from ._inputs i... | 55.147874 | 308 | 0.668108 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from ._inputs import *
from .vpc_cni import VpcCni
import pulumi_aws
import pulumi_kubernetes
__all__ = ['ManagedNodeGroupArgs', 'ManagedNodeGroup']
@pulumi.input_type
... | true | true |
f709c7766e0bf952395f474d0c6055d6f4fbf99a | 37,773 | py | Python | venv/Lib/site-packages/reportlab/graphics/renderSVG.py | lsmiley/esstools-adminlte-3 | ec3a7334be0ab05e9d336e397d6edb881131b932 | [
"MIT"
] | 55 | 2019-09-21T02:45:18.000Z | 2021-12-10T13:38:51.000Z | venv/Lib/site-packages/reportlab/graphics/renderSVG.py | rashikbuksh/Optimal-Transportation-System | 18c6d5341c6d3ecbb1c8fcfba8e46ca2ba493882 | [
"MIT"
] | 4 | 2019-09-26T03:16:50.000Z | 2021-12-10T13:40:49.000Z | venv/Lib/site-packages/reportlab/graphics/renderSVG.py | rashikbuksh/Optimal-Transportation-System | 18c6d5341c6d3ecbb1c8fcfba8e46ca2ba493882 | [
"MIT"
] | 26 | 2019-09-25T03:54:30.000Z | 2022-03-21T14:03:12.000Z | __doc__="""An experimental SVG renderer for the ReportLab graphics framework.
This will create SVG code from the ReportLab Graphics API (RLG).
To read existing SVG code and convert it into ReportLab graphics
objects download the svglib module here:
http://python.net/~gherman/#svglib
"""
import math, types, sys, os... | 38.821172 | 139 | 0.575252 | __doc__="""An experimental SVG renderer for the ReportLab graphics framework.
This will create SVG code from the ReportLab Graphics API (RLG).
To read existing SVG code and convert it into ReportLab graphics
objects download the svglib module here:
http://python.net/~gherman/#svglib
"""
import math, types, sys, os... | true | true |
f709c78660219ac4debdf4bfe4edf56a0cc485d8 | 6,193 | py | Python | pyqtgraph/configfile.py | Tillsten/pyqtgraph | 0045863165fe526988c58cf4f8232ae2d261a5ee | [
"MIT"
] | 5 | 2019-03-08T05:30:20.000Z | 2021-05-15T07:33:50.000Z | pyqtgraph/configfile.py | Tillsten/pyqtgraph | 0045863165fe526988c58cf4f8232ae2d261a5ee | [
"MIT"
] | 1 | 2019-01-14T09:00:21.000Z | 2019-01-14T09:00:21.000Z | pyqtgraph/configfile.py | Tillsten/pyqtgraph | 0045863165fe526988c58cf4f8232ae2d261a5ee | [
"MIT"
] | 1 | 2022-02-01T12:45:29.000Z | 2022-02-01T12:45:29.000Z | # -*- coding: utf-8 -*-
"""
configfile.py - Human-readable text configuration file library
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
Used for reading and writing dictionary objects to a python-like configuration
file format. Data structures may be nested a... | 30.507389 | 131 | 0.501211 |
import re, os, sys
from .pgcollections import OrderedDict
GLOBAL_PATH = None
from . import units
from .python2_3 import asUnicode
class ParseError(Exception):
def __init__(self, message, lineNum, line, fileName=None):
self.lineNum = lineNum
self.line = line
self.fileName = fileN... | true | true |
f709c91120596c3ea3b45b02c68538a4ccfbd7ce | 7,723 | py | Python | tempest/api/compute/volumes/test_volumes_list.py | ssameerr/tempest | e413f28661c2aab3f8da8d005db1fa5c59cc6b68 | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/volumes/test_volumes_list.py | ssameerr/tempest | e413f28661c2aab3f8da8d005db1fa5c59cc6b68 | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/volumes/test_volumes_list.py | ssameerr/tempest | e413f28661c2aab3f8da8d005db1fa5c59cc6b68 | [
"Apache-2.0"
] | 2 | 2015-04-30T08:46:29.000Z | 2020-03-01T17:05:23.000Z | # Copyright 2012 OpenStack Foundation
# 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 requ... | 45.698225 | 79 | 0.604299 |
from tempest.api.compute import base
from tempest.common.utils import data_utils
from tempest.common import waiters
from tempest import config
from tempest import test
CONF = config.CONF
class VolumesTestJSON(base.BaseV2ComputeTest):
@classmethod
def skip_checks(cls):... | true | true |
f709ca6f7784c7430429a65498dd7dcee60b9751 | 468 | py | Python | src/providers/__init__.py | abdellatifLabr/social-media-stocks-tracker | b54f1db488d8b26e292ec025d1af7f8d4b5a94da | [
"MIT"
] | null | null | null | src/providers/__init__.py | abdellatifLabr/social-media-stocks-tracker | b54f1db488d8b26e292ec025d1af7f8d4b5a94da | [
"MIT"
] | null | null | null | src/providers/__init__.py | abdellatifLabr/social-media-stocks-tracker | b54f1db488d8b26e292ec025d1af7f8d4b5a94da | [
"MIT"
] | null | null | null | import os
from importlib import import_module
def get_providers():
for provider_file in os.listdir(os.path.dirname(os.path.abspath(__file__))):
if provider_file[0] != '$':
continue
provider = provider_file.replace('.py', '')
yield import_module(f'{__package__}.{provider}')
d... | 27.529412 | 80 | 0.67094 | import os
from importlib import import_module
def get_providers():
for provider_file in os.listdir(os.path.dirname(os.path.abspath(__file__))):
if provider_file[0] != '$':
continue
provider = provider_file.replace('.py', '')
yield import_module(f'{__package__}.{provider}')
d... | true | true |
f709cc9fb30c63d9a152a36daa62b63547568b39 | 6,798 | py | Python | userbot/modules/updater.py | badwordking/import | 612b6c386a23a925fa44384c93f8fecc7160bee4 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/updater.py | badwordking/import | 612b6c386a23a925fa44384c93f8fecc7160bee4 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/updater.py | badwordking/import | 612b6c386a23a925fa44384c93f8fecc7160bee4 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
"""
This module updates the userbot based on Upstream revision
"""
from os import remove, execle, path, makedirs, gete... | 35.041237 | 106 | 0.598117 |
from os import remove, execle, path, makedirs, getenv
from shutil import rmtree
import asyncio
import sys
from git import Repo
from git.exc import GitCommandError, InvalidGitRepositoryError, NoSuchPathError
from userbot import CMD_HELP, bot, HEROKU_APIKEY, HEROKU_APPNAME, UPSTREAM_REPO_URL
from userbot.events i... | true | true |
f709cf5255d5c1ff9141ddd1b67349a4b9fdd3fb | 8,536 | pyw | Python | venv/Lib/site-packages/PyQt4/examples/widgets/imageviewer.pyw | prateekfxtd/ns_Startup | 095a62b3a8c7bf0ff7b767355d57d993bbd2423d | [
"MIT"
] | 1 | 2022-03-16T02:10:30.000Z | 2022-03-16T02:10:30.000Z | venv/Lib/site-packages/PyQt4/examples/widgets/imageviewer.pyw | prateekfxtd/ns_Startup | 095a62b3a8c7bf0ff7b767355d57d993bbd2423d | [
"MIT"
] | null | null | null | venv/Lib/site-packages/PyQt4/examples/widgets/imageviewer.pyw | prateekfxtd/ns_Startup | 095a62b3a8c7bf0ff7b767355d57d993bbd2423d | [
"MIT"
] | 2 | 2019-05-28T11:58:59.000Z | 2020-09-23T17:21:19.000Z | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2010 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... | 39.702326 | 82 | 0.641167 |
u.addAction(self.openAct)
self.fileMenu.addAction(self.printAct)
self.fileMenu.addSeparator()
self.fileMenu.addAction(self.exitAct)
self.viewMenu = QtGui.QMenu("&View", self)
self.viewMenu.addAction(self.zoomInAct)
self.viewMenu.addAction(self.zoomOutAct)
self... | true | true |
f709cf7002dd1d680b4a2838c2421fcebabdf110 | 7,746 | py | Python | hackathon/annotation_compare_viz.py | cns-iu/ccf-research | e029c8985a249c1caec925e95f5286c505c706ea | [
"MIT"
] | 1 | 2020-09-09T13:45:44.000Z | 2020-09-09T13:45:44.000Z | hackathon/annotation_compare_viz.py | cns-iu/ccf-research | e029c8985a249c1caec925e95f5286c505c706ea | [
"MIT"
] | null | null | null | hackathon/annotation_compare_viz.py | cns-iu/ccf-research | e029c8985a249c1caec925e95f5286c505c706ea | [
"MIT"
] | 4 | 2020-08-14T19:31:56.000Z | 2021-09-07T04:11:45.000Z | import json
from re import split
import shutil
import os
import sys
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from skimage import io
from shapely.geometry import Polygon
Image.MAX_IMAGE_PIXELS = None
def make_dir(path):
if not os.path.exists(path):
os.makedirs(path)
else:
... | 33.102564 | 99 | 0.560676 | import json
from re import split
import shutil
import os
import sys
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from skimage import io
from shapely.geometry import Polygon
Image.MAX_IMAGE_PIXELS = None
def make_dir(path):
if not os.path.exists(path):
os.makedirs(path)
else:
... | true | true |
f709cf992b68de68927df65d68d163fcd1f06b58 | 3,861 | py | Python | mmdet/models/relation_heads/imp_head.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 24 | 2021-10-14T03:28:28.000Z | 2022-03-29T09:30:04.000Z | mmdet/models/relation_heads/imp_head.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-12-14T15:04:49.000Z | 2022-02-19T09:54:42.000Z | mmdet/models/relation_heads/imp_head.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-10-31T11:23:06.000Z | 2021-12-17T06:38:50.000Z | # ---------------------------------------------------------------
# imp_head.py
# Set-up time: 2020/5/21 下午11:22
# Copyright (c) 2020 ICT
# Licensed under The MIT License [see LICENSE for details]
# Written by Kenneth-Wong (Wenbin-Wang) @ VIPL.ICT
# Contact: wenbin.wang@vipl.ict.ac.cn [OR] nkwangwenbin@gmail.com
... | 43.382022 | 108 | 0.597255 |
from ..registry import HEADS
import torch
from .relation_head import RelationHead
from .approaches import IMPContext
from mmdet.core import bbox2roi
@HEADS.register_module
class IMPHead(RelationHead):
def __init__(self, **kwargs):
super(IMPHead, self).__init__(**kwargs)
self... | true | true |
f709d0352b5fa74dda5922641a0d9109bce49efe | 423 | py | Python | PlantEmissionController/PlantEmissionController/asgi.py | sania-dsouza/NRChallenge_Controller | d1dcb665aa7394ec49d89ecda3c49dc09b89f9d6 | [
"MIT"
] | null | null | null | PlantEmissionController/PlantEmissionController/asgi.py | sania-dsouza/NRChallenge_Controller | d1dcb665aa7394ec49d89ecda3c49dc09b89f9d6 | [
"MIT"
] | null | null | null | PlantEmissionController/PlantEmissionController/asgi.py | sania-dsouza/NRChallenge_Controller | d1dcb665aa7394ec49d89ecda3c49dc09b89f9d6 | [
"MIT"
] | null | null | null | """
ASGI config for PlantEmissionController project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefau... | 24.882353 | 83 | 0.801418 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'PlantEmissionController.settings')
application = get_asgi_application()
| true | true |
f709d1ee6bd0960131b9028b1d032f75d54b53f8 | 25,200 | py | Python | stack/stack/imageMath.py | earthobservatory/ariamh-pub | f33731e127f38ff33b02e02c07b16793c07651a6 | [
"Apache-2.0"
] | 4 | 2019-11-19T03:35:35.000Z | 2020-12-07T18:43:11.000Z | stack/stack/imageMath.py | earthobservatory/ariamh-pub | f33731e127f38ff33b02e02c07b16793c07651a6 | [
"Apache-2.0"
] | 3 | 2019-06-05T03:35:55.000Z | 2020-04-09T14:16:08.000Z | stack/stack/imageMath.py | earthobservatory/ariamh-pub | f33731e127f38ff33b02e02c07b16793c07651a6 | [
"Apache-2.0"
] | 6 | 2019-08-23T22:53:11.000Z | 2021-11-06T15:15:30.000Z | #!/usr/bin/env python
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Author: Piyush Agram
# Copyright 2013, by the California Institute of Technology. ALL RIGHTS RESERVED.
# United States Government Sponsorship acknowledged.
# Any commercial use must be negotiated with th... | 32.142857 | 247 | 0.572659 |
import argparse
import symtable
import math
import numpy as np
from numpy.lib.stride_tricks import as_strided
import logging
import os
import sys
helpStr = """
ISCE Band image with imageMath.py
Examples:
*********
1) imageMath.py -e='a*exp(-1.0*J*arg(b))' -o test.int -t cfloat --a=resampOnlyI... | false | true |
f709d34b2d10d8875740a51747de847183d6995e | 13,048 | py | Python | src/models/ast_models.py | jvel07/ast | 600e7cf952ec59ac9cc1bb3170d3da7578e1f384 | [
"BSD-3-Clause"
] | null | null | null | src/models/ast_models.py | jvel07/ast | 600e7cf952ec59ac9cc1bb3170d3da7578e1f384 | [
"BSD-3-Clause"
] | null | null | null | src/models/ast_models.py | jvel07/ast | 600e7cf952ec59ac9cc1bb3170d3da7578e1f384 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 6/10/21 5:04 PM
# @Author : Yuan Gong
# @Affiliation : Massachusetts Institute of Technology
# @Email : yuangong@mit.edu
# @File : ast_models.py
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0,1,2,3"
import torch
import torch... | 56.978166 | 191 | 0.610132 |
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0,1,2,3"
import torch
import torch.nn as nn
from torch.cuda.amp import autocast
import wget
os.environ['TORCH_HOME'] = '../../pretrained_models'
import timm
from timm.models.layers import to_2tuple, trunc_normal_
... | true | true |
f709d36bd178f40879376ac199984275f9458cc3 | 1,113 | py | Python | bin/create_trace_graphviz.py | AlexJew/CityEnergyAnalyst | 6eb372c79e5100a2d0abce78561ae368fb409cd1 | [
"MIT"
] | 1 | 2018-08-16T14:34:23.000Z | 2018-08-16T14:34:23.000Z | bin/create_trace_graphviz.py | AlexJew/CityEnergyAnalyst | 6eb372c79e5100a2d0abce78561ae368fb409cd1 | [
"MIT"
] | null | null | null | bin/create_trace_graphviz.py | AlexJew/CityEnergyAnalyst | 6eb372c79e5100a2d0abce78561ae368fb409cd1 | [
"MIT"
] | null | null | null | """
Read in the output from the trace-inputlocator script and create a GraphViz file.
Pass as input the path to the yaml output of the trace-inputlocator script via config file.
The output is written to the trace-inputlocator location.
WHY? because the trace-inputlocator only has the GraphViz output of the last call ... | 35.903226 | 118 | 0.745732 | from __future__ import print_function
import yaml
import cea.config
from cea.tests.trace_inputlocator import create_graphviz_output
def main(config):
with open(config.trace_inputlocator.yaml_output_file, 'r') as f:
yaml_data = yaml.load(f)
trace_data = []
for script in yaml_data.keys():
f... | true | true |
f709d40f1b6482aa8186bd0b9c536a20d11a426e | 11,220 | py | Python | rest_api/build/lib/rest_api/workflow/main.py | hidura/sawtooth-blockmed | d0e047972557315489de1b308a84f477da6f993d | [
"Apache-2.0"
] | 3 | 2020-06-03T23:09:27.000Z | 2021-05-15T22:21:21.000Z | rest_api/rest_api/workflow/main.py | hidura/sawtooth-blockmed | d0e047972557315489de1b308a84f477da6f993d | [
"Apache-2.0"
] | 6 | 2020-07-21T00:03:29.000Z | 2021-09-28T03:30:02.000Z | rest_api/rest_api/workflow/main.py | hidura/sawtooth-blockmed | d0e047972557315489de1b308a84f477da6f993d | [
"Apache-2.0"
] | 1 | 2020-06-26T03:50:50.000Z | 2020-06-26T03:50:50.000Z | # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 41.25 | 106 | 0.712923 |
import argparse
import asyncio
import logging
import os
from signal import signal, SIGINT
import sys
from sanic import Sanic
from sawtooth_signing import create_context
from sawtooth_signing import ParseError
from sawtooth_signing import CryptoFactory
from zmq.asyncio import ZMQEventLoop
from rest... | true | true |
f709d444e910f6f32e57c5407aa2e7a31cbc3d3d | 6,676 | py | Python | util/security/test/test_jwtutil.py | giuseppe/quay | a1b7e4b51974edfe86f66788621011eef2667e6a | [
"Apache-2.0"
] | 2,027 | 2019-11-12T18:05:48.000Z | 2022-03-31T22:25:04.000Z | util/security/test/test_jwtutil.py | giuseppe/quay | a1b7e4b51974edfe86f66788621011eef2667e6a | [
"Apache-2.0"
] | 496 | 2019-11-12T18:13:37.000Z | 2022-03-31T10:43:45.000Z | util/security/test/test_jwtutil.py | giuseppe/quay | a1b7e4b51974edfe86f66788621011eef2667e6a | [
"Apache-2.0"
] | 249 | 2019-11-12T18:02:27.000Z | 2022-03-22T12:19:19.000Z | import time
import pytest
import jwt
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization
from authlib.jose import jwk
from util.security.jwtutil import (
decode,
exp_max_s_option,
jwk_dict_to_public_key,
InvalidTokenError,
InvalidAlgo... | 27.933054 | 100 | 0.560815 | import time
import pytest
import jwt
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization
from authlib.jose import jwk
from util.security.jwtutil import (
decode,
exp_max_s_option,
jwk_dict_to_public_key,
InvalidTokenError,
InvalidAlgo... | true | true |
f709d502b186aa12fa05d2db0b3fe245571830c7 | 4,145 | py | Python | mas_cache/models.py | blochberger/mas-cache | f7f507365220cd6a3628de1266a510a750121f0c | [
"0BSD"
] | 1 | 2020-04-24T09:02:53.000Z | 2020-04-24T09:02:53.000Z | mas_cache/models.py | blochberger/mas-cache | f7f507365220cd6a3628de1266a510a750121f0c | [
"0BSD"
] | null | null | null | mas_cache/models.py | blochberger/mas-cache | f7f507365220cd6a3628de1266a510a750121f0c | [
"0BSD"
] | null | null | null | from typing import Any, Dict, Optional
from django.contrib.postgres.fields import JSONField
from django.core.validators import RegexValidator
from django.db import models
from django.utils.timezone import datetime
from django.utils.translation import gettext_lazy as _
from core.fields import IntegerChoicesField
# V... | 23.027778 | 77 | 0.7269 | from typing import Any, Dict, Optional
from django.contrib.postgres.fields import JSONField
from django.core.validators import RegexValidator
from django.db import models
from django.utils.timezone import datetime
from django.utils.translation import gettext_lazy as _
from core.fields import IntegerChoicesField
... | true | true |
f709d58d517711bebc218d0488e153bc0a08ffde | 443 | py | Python | switches/migrations/0002_auto_20161227_1515.py | schatten/django-migration-workflow | 91e6def9cf54e36c3b9cba6d7c28b63f945ca954 | [
"MIT"
] | null | null | null | switches/migrations/0002_auto_20161227_1515.py | schatten/django-migration-workflow | 91e6def9cf54e36c3b9cba6d7c28b63f945ca954 | [
"MIT"
] | null | null | null | switches/migrations/0002_auto_20161227_1515.py | schatten/django-migration-workflow | 91e6def9cf54e36c3b9cba6d7c28b63f945ca954 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-27 15:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('switches', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 21.095238 | 50 | 0.609481 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('switches', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='farfaraway',
name='last',
fiel... | true | true |
f709d6c3320473f055bd3d81082bcccaa89dcb9b | 5,733 | py | Python | ticketer/ticketer/middlewares.py | chiselko6/ticketer | 9d9af440e75452478ba99cba659fca4d1ef4c12b | [
"MIT"
] | null | null | null | ticketer/ticketer/middlewares.py | chiselko6/ticketer | 9d9af440e75452478ba99cba659fca4d1ef4c12b | [
"MIT"
] | null | null | null | ticketer/ticketer/middlewares.py | chiselko6/ticketer | 9d9af440e75452478ba99cba659fca4d1ef4c12b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from typing import Iterable
from scrapy import signals
from .items import TransportInfo, SeatInfo
from .settings import MOCKED_DATA_PATH
class Tic... | 33.331395 | 94 | 0.652189 |
from typing import Iterable
from scrapy import signals
from .items import TransportInfo, SeatInfo
from .settings import MOCKED_DATA_PATH
class TicketerSpiderMiddleware(object):
@classmethod
def from_crawler(cls, crawler):
s = cls()
crawler.signals.connect(s.sp... | true | true |
f709d75432845ad140645213ccef7f5b9231db73 | 1,026 | py | Python | marvelous/dates.py | rkuykendall/marvelous | 7c362643c7327b8fffab941e04fe43dcc7e2d2f9 | [
"MIT"
] | 14 | 2016-07-13T19:48:35.000Z | 2021-11-01T01:47:04.000Z | marvelous/dates.py | rkuykendall/marvelous | 7c362643c7327b8fffab941e04fe43dcc7e2d2f9 | [
"MIT"
] | 19 | 2016-10-31T21:55:18.000Z | 2021-10-31T21:50:37.000Z | marvelous/dates.py | rkuykendall/marvelous | 7c362643c7327b8fffab941e04fe43dcc7e2d2f9 | [
"MIT"
] | 6 | 2016-07-21T19:09:33.000Z | 2021-05-16T12:36:47.000Z | from marshmallow import INCLUDE, Schema, fields, post_load, pre_load
class Dates:
def __init__(self, on_sale=None, foc=None, unlimited=None, **kwargs):
self.on_sale = on_sale
self.foc = foc
self.unlimited = unlimited
self.unknown = kwargs
class DatesSchema(Schema):
onsaleDate... | 29.314286 | 75 | 0.609162 | from marshmallow import INCLUDE, Schema, fields, post_load, pre_load
class Dates:
def __init__(self, on_sale=None, foc=None, unlimited=None, **kwargs):
self.on_sale = on_sale
self.foc = foc
self.unlimited = unlimited
self.unknown = kwargs
class DatesSchema(Schema):
onsaleDate... | true | true |
f709d768543bcd6310dd9e2b12e5531a81c54d69 | 15 | py | Python | text_store/filters.py | digirati-co-uk/drf-text-store | ca29cfc4522d0f718e0419f956705b845e77dae4 | [
"MIT"
] | null | null | null | text_store/filters.py | digirati-co-uk/drf-text-store | ca29cfc4522d0f718e0419f956705b845e77dae4 | [
"MIT"
] | null | null | null | text_store/filters.py | digirati-co-uk/drf-text-store | ca29cfc4522d0f718e0419f956705b845e77dae4 | [
"MIT"
] | null | null | null | # Placeholder
| 7.5 | 14 | 0.733333 | true | true | |
f709d7a5951382a166dd35184fa8a0d66be3aabe | 280 | py | Python | opm/external/sentiment.py | Open-Prose-Metrics/open_prose_metrics_app-core | 9df65edfe9ee9af0a0731c3f2e21ea25bced250c | [
"MIT"
] | null | null | null | opm/external/sentiment.py | Open-Prose-Metrics/open_prose_metrics_app-core | 9df65edfe9ee9af0a0731c3f2e21ea25bced250c | [
"MIT"
] | 4 | 2021-04-30T21:38:10.000Z | 2022-01-13T03:32:33.000Z | opm/external/sentiment.py | Open-Prose-Metrics/open_prose_metrics_app-core | 9df65edfe9ee9af0a0731c3f2e21ea25bced250c | [
"MIT"
] | 1 | 2021-03-21T14:08:28.000Z | 2021-03-21T14:08:28.000Z | #external tools: textgain
import requests
import json
def sentiment_result(text):
URL = 'http://text-processing.com/api/sentiment/'
raw_text = text
r = requests.post(URL, data = {'text':raw_text})
sentiment = json.loads(r.text).get('label')
return sentiment
| 23.333333 | 53 | 0.692857 |
import requests
import json
def sentiment_result(text):
URL = 'http://text-processing.com/api/sentiment/'
raw_text = text
r = requests.post(URL, data = {'text':raw_text})
sentiment = json.loads(r.text).get('label')
return sentiment
| true | true |
f709d7d9a6c3f3c9af884ebe9c62a536e3dfa929 | 597 | py | Python | verification_rules/common/__init__.py | adrianmkng/watchmen | 4be15ad64a5d54d4f546ca8c139fa41fd42dd6aa | [
"Apache-2.0"
] | 190 | 2017-12-13T05:01:42.000Z | 2021-11-15T23:35:54.000Z | verification_rules/common/__init__.py | adrianmkng/watchmen | 4be15ad64a5d54d4f546ca8c139fa41fd42dd6aa | [
"Apache-2.0"
] | 2 | 2018-08-31T04:53:03.000Z | 2018-11-14T00:13:49.000Z | verification_rules/common/__init__.py | adrianmkng/watchmen | 4be15ad64a5d54d4f546ca8c139fa41fd42dd6aa | [
"Apache-2.0"
] | 22 | 2017-12-13T04:36:46.000Z | 2021-07-29T07:37:41.000Z | # Copyright 2017 Insurance Australia Group Limited
#
# 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 ag... | 39.8 | 74 | 0.768844 | true | true | |
f709d888f5758c6ed386e7b17bb06d42626a0d5d | 33,351 | py | Python | Lib/aifc.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 5 | 2022-03-26T21:53:36.000Z | 2022-03-30T21:47:20.000Z | Lib/aifc.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 6 | 2020-11-18T15:48:14.000Z | 2021-05-03T21:20:50.000Z | Lib/aifc.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 2 | 2015-07-16T08:14:13.000Z | 2022-03-27T01:55:17.000Z | """Stuff to parse AIFF-C and AIFF files.
Unless explicitly stated otherwise, the description below is true
both for AIFF-C files and AIFF files.
An AIFF-C file has the following structure.
+-----------------+
| FORM |
+-----------------+
| <size> |
+----+------------+
| | AIFC ... | 34.740625 | 93 | 0.575065 | """Stuff to parse AIFF-C and AIFF files.
Unless explicitly stated otherwise, the description below is true
both for AIFF-C files and AIFF files.
An AIFF-C file has the following structure.
+-----------------+
| FORM |
+-----------------+
| <size> |
+----+------------+
| | AIFC ... | false | true |
f709d89cfc1fad043efd50cf5039f023c148e8cd | 419 | py | Python | eventmanager/categories/migrations/0002_category_category_image.py | ralcabes/EventManager | dd73b2387228b4508d27974a8eeb222d5ffeecdc | [
"MIT"
] | 4 | 2019-01-06T16:58:20.000Z | 2019-04-08T10:20:46.000Z | eventmanager/categories/migrations/0002_category_category_image.py | ralcabes/EventManager | dd73b2387228b4508d27974a8eeb222d5ffeecdc | [
"MIT"
] | 297 | 2018-11-14T13:59:19.000Z | 2022-03-11T23:33:28.000Z | eventmanager/categories/migrations/0002_category_category_image.py | ralcabes/EventManager | dd73b2387228b4508d27974a8eeb222d5ffeecdc | [
"MIT"
] | 1 | 2019-04-22T15:17:32.000Z | 2019-04-22T15:17:32.000Z | # Generated by Django 2.1.5 on 2019-02-01 08:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('categories', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='category',
name='category_image',
... | 22.052632 | 83 | 0.610979 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('categories', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='category',
name='category_image',
field=models.ImageField(blank=True, n... | true | true |
f709d8e6fdd3da9cbade87b9b8ef4c5d23380806 | 1,121 | py | Python | payment/urls.py | skyydq/GreaterWMS | e14014a73b36ec0f0df03712a229b0931cb388fb | [
"Apache-2.0"
] | null | null | null | payment/urls.py | skyydq/GreaterWMS | e14014a73b36ec0f0df03712a229b0931cb388fb | [
"Apache-2.0"
] | null | null | null | payment/urls.py | skyydq/GreaterWMS | e14014a73b36ec0f0df03712a229b0931cb388fb | [
"Apache-2.0"
] | 1 | 2021-07-01T03:05:21.000Z | 2021-07-01T03:05:21.000Z | """singosgu URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | 36.16129 | 123 | 0.706512 | from django.urls import path, re_path
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
path(r'freight/', views.TransportationFeeListViewSet.as_view({"get": "list", "post": "create"}), name="transportationfee"),
re_path(r'^freight/(?P<pk>\d+)/$', views.Tra... | true | true |
f709d94bfb6b20dabb81896e00c628fa1b92786d | 4,040 | py | Python | pyfesom/fesom2gdal.py | pgierz/pyfesom | 6bff7c9a10a080ccb0e089cde0cd0005cd13644d | [
"MIT"
] | null | null | null | pyfesom/fesom2gdal.py | pgierz/pyfesom | 6bff7c9a10a080ccb0e089cde0cd0005cd13644d | [
"MIT"
] | null | null | null | pyfesom/fesom2gdal.py | pgierz/pyfesom | 6bff7c9a10a080ccb0e089cde0cd0005cd13644d | [
"MIT"
] | null | null | null | # Save the geometry (triangles, verticies) of a FESOM grid to a gdal dataset
# Author: R. Rietbroek
# Date 17 May 2019
# Currently this save the surface nodes only
# Improvements are possible
# * Optionally store the 3D surfaces
# * add info on e.g. bathymetry the nodes
# *
import osgeo,ogr as ogr
import osgeo.osr as... | 38.113208 | 149 | 0.690347 |
import osgeo,ogr as ogr
import osgeo.osr as osr
def fesom2gdal(mesh,outputname,gdaldriver='GPKG'):
driver = ogr.GetDriverByName(gdaldriver)
data_source = driver.CreateDataSource(outputname)
srs = osr.SpatialReference()
srs.ImportFromEPSG(4326)
vertlayer = data_source.CreateLay... | true | true |
f709d99e36430fd0fbf77d273f9236d04f2c7a44 | 4,175 | py | Python | settings.py | proffalken/edison | 5bfa941f8876cb8698cd8009c4514bc03d24c109 | [
"BSD-3-Clause"
] | 3 | 2015-11-05T07:29:00.000Z | 2021-06-17T23:44:17.000Z | settings.py | proffalken/edison | 5bfa941f8876cb8698cd8009c4514bc03d24c109 | [
"BSD-3-Clause"
] | 1 | 2016-05-04T10:54:48.000Z | 2016-05-04T10:54:56.000Z | settings.py | proffalken/edison | 5bfa941f8876cb8698cd8009c4514bc03d24c109 | [
"BSD-3-Clause"
] | null | null | null | # This file is part of the Edison Project.
# Please refer to the LICENSE document that was supplied with this software for information on how it can be used.
# Django settings for Edison project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
# Django Debug Toolbar set... | 35.683761 | 114 | 0.734371 |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
INTERNAL_IPS = ('127.0.0.1','192.168.1.56','192.168.3.57')
DEBUG_TOOLBAR_PANELS = (
'debug_toolbar.panels.version.VersionDebugPanel',
'debug_toolbar.panels.timer.TimerDebugPanel',
'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
'... | true | true |
f709d9ab7f9abe834c26068d509b0d3e3b154b68 | 9,223 | py | Python | tests/test_morse.py | amandalynnes/morse-code-bits | 88d1f66404824c0d882c59811324996d4b2baf6b | [
"MIT"
] | null | null | null | tests/test_morse.py | amandalynnes/morse-code-bits | 88d1f66404824c0d882c59811324996d4b2baf6b | [
"MIT"
] | null | null | null | tests/test_morse.py | amandalynnes/morse-code-bits | 88d1f66404824c0d882c59811324996d4b2baf6b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# flake8: noqa
"""
Unit tests for Morse Code: Bits
Students should not modify this file.
"""
__author__ = 'madarp'
import sys
import unittest
import importlib
import subprocess
# suppress __pycache__ and .pyc files
sys.dont_write_bytecode = True
# Kenzie devs: change t... | 54.252941 | 654 | 0.70682 |
__author__ = 'madarp'
import sys
import unittest
import importlib
import subprocess
sys.dont_write_bytecode = True
PKG_NAME = 'morse'
morse_hey_jude = '.... . -.-- .--- ..- -.. .'
morse_quick_fox = '- .... . --.- ..- .. -.-. -.- -... .-. --- .-- -. ..-. --- -..- .--- ..- -- .--. ... --- ...- . .... | true | true |
f709d9bb17cf6263074bdfc8c1b3ba2b28108867 | 9,762 | py | Python | cloudkitty/dataframe.py | wanghuiict/cloudkitty | 11ff713042eb0354f497f7051130630c46860735 | [
"Apache-2.0"
] | 97 | 2015-10-18T02:53:17.000Z | 2022-03-07T05:15:39.000Z | cloudkitty/dataframe.py | shanafang9/cloudkitty | 911c90569ccb09ecf0d7aa11a5a707c8ebda09cf | [
"Apache-2.0"
] | 1 | 2022-01-20T16:35:22.000Z | 2022-01-20T16:35:22.000Z | cloudkitty/dataframe.py | shanafang9/cloudkitty | 911c90569ccb09ecf0d7aa11a5a707c8ebda09cf | [
"Apache-2.0"
] | 54 | 2015-10-27T10:55:02.000Z | 2022-02-18T08:23:19.000Z | # Copyright 2019 Objectif Libre
#
# 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 agr... | 34.864286 | 79 | 0.571809 |
import collections
import datetime
import decimal
import functools
import voluptuous
from werkzeug import datastructures
from cloudkitty.utils import json
from cloudkitty.utils import tz as tzutils
from cloudkitty.utils import validation as vutils
DATAPOINT_SCHEMA = voluptuous.Schema({
voluptuo... | true | true |
f709da8f28d7264755b7b14dc5e8586d8b1e7424 | 2,523 | py | Python | src/collective/solr/browser/controlpanel.py | IMIO/collective.solr | 844219eb3968b34d2b83a7bd5f59340d676d149e | [
"ZPL-1.1"
] | null | null | null | src/collective/solr/browser/controlpanel.py | IMIO/collective.solr | 844219eb3968b34d2b83a7bd5f59340d676d149e | [
"ZPL-1.1"
] | null | null | null | src/collective/solr/browser/controlpanel.py | IMIO/collective.solr | 844219eb3968b34d2b83a7bd5f59340d676d149e | [
"ZPL-1.1"
] | null | null | null | # -*- coding: utf-8 -*-
from plone.app.registry.browser import controlpanel
from plone.protect.interfaces import IDisableCSRFProtection
from collective.solr.interfaces import ISolrSchema, _
from plone.restapi.controlpanels import RegistryConfigletPanel
from Products.CMFPlone.utils import safe_unicode
from Products.Five... | 37.656716 | 77 | 0.70432 |
from plone.app.registry.browser import controlpanel
from plone.protect.interfaces import IDisableCSRFProtection
from collective.solr.interfaces import ISolrSchema, _
from plone.restapi.controlpanels import RegistryConfigletPanel
from Products.CMFPlone.utils import safe_unicode
from Products.Five.browser.pagetemplatefi... | true | true |
f709dac114e4abf7ce428aa013816678149fbf10 | 19 | py | Python | btd6_memory_info/generated/SteamNative/Platform/Linux32/linux32.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/SteamNative/Platform/Linux32/linux32.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/SteamNative/Platform/Linux32/linux32.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class Linux32: pass | 19 | 19 | 0.842105 | class Linux32: pass | true | true |
f709db49836f0a337d880632a4ab2b1e17e82610 | 1,896 | py | Python | hooks/hook-pygame.py | tappi287/rf2_video_settings | 6ae73c63f48e6d515a9efb653f236dea0494d9f1 | [
"MIT"
] | 8 | 2020-12-09T17:34:40.000Z | 2022-02-21T10:15:09.000Z | hooks/hook-pygame.py | tappi287/rf2_video_settings | 6ae73c63f48e6d515a9efb653f236dea0494d9f1 | [
"MIT"
] | 11 | 2021-02-27T00:21:47.000Z | 2022-02-25T14:41:56.000Z | hooks/hook-pygame.py | tappi287/rf2_video_settings | 6ae73c63f48e6d515a9efb653f236dea0494d9f1 | [
"MIT"
] | 2 | 2021-06-28T21:11:53.000Z | 2022-02-06T17:20:18.000Z | """
binaries hook for pygame seems to be required for pygame 2.0 Windows.
Otherwise some essential DLLs will not be transfered to the exe.
And also put hooks for datas, resources that pygame uses, to work
correctly with pyinstaller
"""
import os
import platform
from pygame import __file__ as pygame_main_file
# Get... | 33.857143 | 118 | 0.701477 |
import os
import platform
from pygame import __file__ as pygame_main_file
pygame_folder = os.path.dirname(os.path.abspath(pygame_main_file))
# datas is the variable that pyinstaller looks for while processing hooks
datas = []
# exclude some unneeded binaries
exclude_bin = ('libFLAC-8', 'libfreetype-6', 'libjpeg-9... | true | true |
f709dc15484ea8df0fa2f57cf6db9d359d0459e7 | 3,324 | py | Python | covid/scraper/scraper/spiders/chem_archive.py | IanVermes/covid-timeseries | 9ba0fe8bfb031b4cf39fe879e2ee2b4c57acfb6d | [
"MIT"
] | null | null | null | covid/scraper/scraper/spiders/chem_archive.py | IanVermes/covid-timeseries | 9ba0fe8bfb031b4cf39fe879e2ee2b4c57acfb6d | [
"MIT"
] | null | null | null | covid/scraper/scraper/spiders/chem_archive.py | IanVermes/covid-timeseries | 9ba0fe8bfb031b4cf39fe879e2ee2b4c57acfb6d | [
"MIT"
] | null | null | null | import scrapy
import json
import datetime
POSTED_DATE_FORMAT = "%Y-%m-%d"
# BOOKMARK is cursor that tracks just how far back we should scrape each time
BOOKMARK = datetime.datetime(
year=2020, month=1, day=1
) # TODO factor bookmark into its own logic
class ChemRXIVSpider(scrapy.Spider):
name = "chemrxiv"
... | 33.575758 | 160 | 0.651625 | import scrapy
import json
import datetime
POSTED_DATE_FORMAT = "%Y-%m-%d"
BOOKMARK = datetime.datetime(
year=2020, month=1, day=1
)
class ChemRXIVSpider(scrapy.Spider):
name = "chemrxiv"
start_urls = [
"https://chemrxiv.org/api/institutions/259/items?types=&licenses=&orderBy=published_date&or... | true | true |
f709dd6cd4a7b3bebd5b0ef0464275cfb26ad043 | 407 | py | Python | managair_server/asgi.py | ClairBerlin/managair | 44af9f73039ecdb7dd959dacda5470a103795ac3 | [
"BSD-3-Clause"
] | 4 | 2020-11-22T17:07:14.000Z | 2020-11-26T07:53:08.000Z | managair_server/asgi.py | ClairBerlin/managair | 44af9f73039ecdb7dd959dacda5470a103795ac3 | [
"BSD-3-Clause"
] | 18 | 2020-12-04T07:48:13.000Z | 2022-01-26T18:09:33.000Z | managair_server/asgi.py | ClairBerlin/managair | 44af9f73039ecdb7dd959dacda5470a103795ac3 | [
"BSD-3-Clause"
] | 1 | 2021-01-15T10:41:33.000Z | 2021-01-15T10:41:33.000Z | """
ASGI config for managair_server project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault("DJAN... | 23.941176 | 78 | 0.793612 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "managair_server.settings")
application = get_asgi_application()
| true | true |
f709ddc3dbd9c527b7a989ae3912f0fba65d1fdc | 17,847 | py | Python | selfdrive/thermald/thermald.py | doudoune144/openpilot-1 | 61b8df815ff47c9cf013b0a40fd86357629595d9 | [
"MIT"
] | null | null | null | selfdrive/thermald/thermald.py | doudoune144/openpilot-1 | 61b8df815ff47c9cf013b0a40fd86357629595d9 | [
"MIT"
] | null | null | null | selfdrive/thermald/thermald.py | doudoune144/openpilot-1 | 61b8df815ff47c9cf013b0a40fd86357629595d9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import datetime
import os
import time
from pathlib import Path
from typing import Dict, Optional, Tuple
from collections import namedtuple, OrderedDict
import psutil
from smbus2 import SMBus
import cereal.messaging as messaging
from cereal import log
from common.filter_simple import FirstOrderF... | 39.74833 | 159 | 0.724884 |
import datetime
import os
import time
from pathlib import Path
from typing import Dict, Optional, Tuple
from collections import namedtuple, OrderedDict
import psutil
from smbus2 import SMBus
import cereal.messaging as messaging
from cereal import log
from common.filter_simple import FirstOrderFilter
from common.nump... | true | true |
f709dee36890489202122bfddea93ac90a757167 | 788 | py | Python | utils.py | zhaohengyin/irgail_example | 89f7661b5ab08bdf79686eaf8933ad7b5badced4 | [
"MIT"
] | 1 | 2021-11-01T16:39:38.000Z | 2021-11-01T16:39:38.000Z | utils.py | zhaohengyin/irgail_example | 89f7661b5ab08bdf79686eaf8933ad7b5badced4 | [
"MIT"
] | null | null | null | utils.py | zhaohengyin/irgail_example | 89f7661b5ab08bdf79686eaf8933ad7b5badced4 | [
"MIT"
] | 1 | 2022-03-31T08:41:24.000Z | 2022-03-31T08:41:24.000Z | from tqdm import tqdm
import numpy as np
import torch
import torch.nn as nn
def build_mlp(input_dim, output_dim, hidden_units=[64, 64],
hidden_activation=nn.Tanh(), output_activation=None):
layers = []
units = input_dim
for next_units in hidden_units:
layers.append(nn.Linear(units, ne... | 32.833333 | 113 | 0.694162 | from tqdm import tqdm
import numpy as np
import torch
import torch.nn as nn
def build_mlp(input_dim, output_dim, hidden_units=[64, 64],
hidden_activation=nn.Tanh(), output_activation=None):
layers = []
units = input_dim
for next_units in hidden_units:
layers.append(nn.Linear(units, ne... | true | true |
f709dee74479c981102c7a864b5177e2cac5f198 | 3,167 | py | Python | aiida_sirius/calculations/md.py | simonpintarelli/aiida-sirius | 5dc968cc4a98a5d0b018f54c4c7023b2a2682795 | [
"MIT"
] | null | null | null | aiida_sirius/calculations/md.py | simonpintarelli/aiida-sirius | 5dc968cc4a98a5d0b018f54c4c7023b2a2682795 | [
"MIT"
] | null | null | null | aiida_sirius/calculations/md.py | simonpintarelli/aiida-sirius | 5dc968cc4a98a5d0b018f54c4c7023b2a2682795 | [
"MIT"
] | null | null | null | from .scf_base import SiriusBaseCalculation, make_sirius_json
from aiida.plugins import DataFactory
from aiida.common import datastructures
import tempfile
import json
import yaml
import six
SiriusMDParameters = DataFactory('sirius.md')
SinglefileData = DataFactory('singlefile')
ArrayData = DataFactory('array')
List =... | 43.383562 | 117 | 0.696558 | from .scf_base import SiriusBaseCalculation, make_sirius_json
from aiida.plugins import DataFactory
from aiida.common import datastructures
import tempfile
import json
import yaml
import six
SiriusMDParameters = DataFactory('sirius.md')
SinglefileData = DataFactory('singlefile')
ArrayData = DataFactory('array')
List =... | true | true |
f709e0169cf531779c077a3169173978a2d4127b | 14,174 | py | Python | homeassistant/components/sensor/netatmo.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 3 | 2019-01-31T13:41:37.000Z | 2020-05-20T14:22:18.000Z | homeassistant/components/sensor/netatmo.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 5 | 2021-02-08T20:32:11.000Z | 2022-01-13T01:19:23.000Z | homeassistant/components/sensor/netatmo.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 1 | 2021-05-31T08:13:56.000Z | 2021-05-31T08:13:56.000Z | """
Support for the NetAtmo Weather Service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.netatmo/
"""
import logging
from time import time
import threading
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
f... | 39.703081 | 78 | 0.546494 | import logging
from time import time
import threading
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
TEMP_CELSIUS, DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE,
STATE_UNKNOWN)
from homeassistant.helpers.entity import Entity
import home... | true | true |
f709e2dc077fbe724912bba68ee39dfd98f80d1e | 30,132 | py | Python | main.py | AswinR12/Minecraft | aff05fedf918a9500a597e89a26be62277ad717d | [
"MIT"
] | null | null | null | main.py | AswinR12/Minecraft | aff05fedf918a9500a597e89a26be62277ad717d | [
"MIT"
] | null | null | null | main.py | AswinR12/Minecraft | aff05fedf918a9500a597e89a26be62277ad717d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from __future__ import division
import sys
import math
import random
import time
from collections import deque
from pyglet import image
from pyglet.gl import *
from pyglet.graphics import TextureGroup
from pyglet.window import key, mouse
TICKS_PER_SEC = 60
# Size of sectors used to ease block... | 33.331858 | 80 | 0.551374 |
from __future__ import division
import sys
import math
import random
import time
from collections import deque
from pyglet import image
from pyglet.gl import *
from pyglet.graphics import TextureGroup
from pyglet.window import key, mouse
TICKS_PER_SEC = 60
SECTOR_SIZE = 16
WALKING_SPEED = 5
FLYING_SPEED = 15
GR... | true | true |
f709e44133af35e725e4b68ac6b7a629db5beee6 | 2,755 | py | Python | gameoflife.py | zvolsky/game-of-live | b890a7a242eb77e40827a491f6dae35db8e76791 | [
"MIT"
] | null | null | null | gameoflife.py | zvolsky/game-of-live | b890a7a242eb77e40827a491f6dae35db8e76791 | [
"MIT"
] | null | null | null | gameoflife.py | zvolsky/game-of-live | b890a7a242eb77e40827a491f6dae35db8e76791 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
def get_next_one(wint):
"""
returns next generation as list of rows where each row contain string of 0|1 characters
:param wint array of integers 0|1 older generation
:retval next_one list of rows next generation
"""
ne... | 28.697917 | 95 | 0.561525 |
import sys
def get_next_one(wint):
next_one = []
rows = len(wint)
cols = len(wint[0])
def fixed_i(i):
if 0 <= i < rows:
return i
return i % rows
def fixed_j(j):
if 0 <= j < cols:
return j
return divmod(j, cols)[1]
def neigh... | true | true |
f709e4763d6147628220533467681f80b7493dbe | 1,762 | py | Python | geonition/data_migrate.py | geonition/releases | eb2701f0333f5a9577bff9034f2a179dce9fe93d | [
"MIT"
] | null | null | null | geonition/data_migrate.py | geonition/releases | eb2701f0333f5a9577bff9034f2a179dce9fe93d | [
"MIT"
] | 2 | 2020-02-12T01:09:51.000Z | 2020-06-05T18:39:18.000Z | geonition/data_migrate.py | geonition/releases | eb2701f0333f5a9577bff9034f2a179dce9fe93d | [
"MIT"
] | null | null | null | from django.core.management import setup_environ
from geonition import settings
setup_environ(settings)
jsonfile = open("../data/geojson_rest.json")
print jsonfile
import json
json_list = json.loads(jsonfile.read())
jsonfile.close()
data_dict = {}
for obj in json_list:
if obj['model'] == 'geojson_rest.featur... | 27.107692 | 90 | 0.660613 | from django.core.management import setup_environ
from geonition import settings
setup_environ(settings)
jsonfile = open("../data/geojson_rest.json")
print jsonfile
import json
json_list = json.loads(jsonfile.read())
jsonfile.close()
data_dict = {}
for obj in json_list:
if obj['model'] == 'geojson_rest.featur... | false | true |
f709e4c35e93001402d4351c8505981f77b535e5 | 562 | py | Python | senior project/code and resources/setup.py | amiel445566/my-tetris | e738d791b685dbf6356e252450d366c747205087 | [
"MIT"
] | null | null | null | senior project/code and resources/setup.py | amiel445566/my-tetris | e738d791b685dbf6356e252450d366c747205087 | [
"MIT"
] | null | null | null | senior project/code and resources/setup.py | amiel445566/my-tetris | e738d791b685dbf6356e252450d366c747205087 | [
"MIT"
] | null | null | null | import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"optimize": 2,
"packages": ["dbm"],
"include_files": ["image(s)", "font(s)", "db", "README.txt"]
}
setup( na... | 37.466667 | 100 | 0.581851 | import sys
from cx_Freeze import setup, Executable
build_exe_options = {"optimize": 2,
"packages": ["dbm"],
"include_files": ["image(s)", "font(s)", "db", "README.txt"]
}
setup( name = "Tetris Code",
version = "3.6",
options = {"build_ex... | true | true |
f709e537d90b2efbc045e695c664188d4d468ba0 | 6,501 | py | Python | reprounzip/reprounzip/unpackers/common/packages.py | BinalModi/reprozip | 0edec88ab63cb1b724af291579a74a654d0bbe07 | [
"BSD-3-Clause"
] | null | null | null | reprounzip/reprounzip/unpackers/common/packages.py | BinalModi/reprozip | 0edec88ab63cb1b724af291579a74a654d0bbe07 | [
"BSD-3-Clause"
] | null | null | null | reprounzip/reprounzip/unpackers/common/packages.py | BinalModi/reprozip | 0edec88ab63cb1b724af291579a74a654d0bbe07 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2014-2017 New York University
# This file is part of ReproZip which is released under the Revised BSD License
# See file LICENSE for full license details.
"""Utility functions dealing with package managers.
"""
from __future__ import division, print_function, unicode_literals
import logging
import pl... | 34.579787 | 79 | 0.565913 |
from __future__ import division, print_function, unicode_literals
import logging
import platform
import subprocess
from reprounzip.unpackers.common.misc import UsageError
from reprounzip.utils import itervalues
logger = logging.getLogger('reprounzip')
THIS_DISTRIBUTION = platform.linux_distribution()[0].lowe... | true | true |
f709e6526e94512916db6bbbad0310168e0c4165 | 31,430 | py | Python | lib/transaction.py | Rikski/welectrum | 2e2c5a15c9f36c36a852d745ff043ac96ec1b2f6 | [
"MIT"
] | 1 | 2017-08-24T11:02:24.000Z | 2017-08-24T11:02:24.000Z | lib/transaction.py | Rikski/welectrum | 2e2c5a15c9f36c36a852d745ff043ac96ec1b2f6 | [
"MIT"
] | null | null | null | lib/transaction.py | Rikski/welectrum | 2e2c5a15c9f36c36a852d745ff043ac96ec1b2f6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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... | 35.594564 | 137 | 0.572669 |
import bitcoin
from bitcoin import *
from util import print_error, profiler
import time
import sys
import struct
#
import struct
import StringIO
import random
NO_SIGNATURE = 'ff'
class SerializationError(Exception):
""" Thrown when there's a problem deserializing or serializing "... | false | true |
f709e682d5539283db2e19111debac252c2cc9d9 | 32,992 | py | Python | kubernetes_asyncio/client/models/extensions_v1beta1_pod_security_policy_spec.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/extensions_v1beta1_pod_security_policy_spec.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/extensions_v1beta1_pod_security_policy_spec.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 Extensions... | 45.506207 | 586 | 0.710839 |
import pprint
import re
import six
class ExtensionsV1beta1PodSecurityPolicySpec(object):
openapi_types = {
'allow_privilege_escalation': 'bool',
'allowed_csi_drivers': 'list[ExtensionsV1beta1AllowedCSIDriver]',
'allowed_capabilities': 'list[str]',
'allowed_flex_volumes': 'l... | true | true |
f709e710939fad538b4dab0bbc8c4fbe215db882 | 34,421 | py | Python | python/cuml/feature_extraction/_vectorizers.py | siddheshmhatre/cuml | ed0e58c6b3ebfc17b944cdad7c04cd4af8860736 | [
"Apache-2.0"
] | 2,743 | 2018-10-11T17:28:58.000Z | 2022-03-31T19:20:50.000Z | python/cuml/feature_extraction/_vectorizers.py | siddheshmhatre/cuml | ed0e58c6b3ebfc17b944cdad7c04cd4af8860736 | [
"Apache-2.0"
] | 4,280 | 2018-10-11T22:29:57.000Z | 2022-03-31T22:02:44.000Z | python/cuml/feature_extraction/_vectorizers.py | siddheshmhatre/cuml | ed0e58c6b3ebfc17b944cdad7c04cd4af8860736 | [
"Apache-2.0"
] | 454 | 2018-10-11T17:40:56.000Z | 2022-03-25T17:07:09.000Z | # Copyright (c) 2020-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 37.051668 | 79 | 0.604863 |
from cudf import Series
from cuml.common.exceptions import NotFittedError
from cuml.feature_extraction._stop_words import ENGLISH_STOP_WORDS
from cuml.common.sparsefuncs import csr_row_normalize_l1, csr_row_normalize_l2
from cuml.common.sparsefuncs import create_csr_matrix_from_count_df
from functools im... | true | true |
f709e7d57692258edd0459ea50391cace46e9b24 | 2,825 | py | Python | chillow/service/ai/search_tree_pathfinding_ai.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 3 | 2021-01-17T23:32:07.000Z | 2022-01-30T14:49:16.000Z | chillow/service/ai/search_tree_pathfinding_ai.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-01-17T13:37:56.000Z | 2021-04-14T12:28:49.000Z | chillow/service/ai/search_tree_pathfinding_ai.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-04-02T14:53:38.000Z | 2021-04-20T11:10:17.000Z | from multiprocessing import Value
from random import choice
from chillow.service.ai.pathfinding_ai import PathfindingAI
from chillow.service.ai.search_tree_ai import SearchTreeAI
from chillow.model.action import Action
from chillow.model.game import Game
from chillow.model.player import Player
from chillow.service.gam... | 47.881356 | 117 | 0.695575 | from multiprocessing import Value
from random import choice
from chillow.service.ai.pathfinding_ai import PathfindingAI
from chillow.service.ai.search_tree_ai import SearchTreeAI
from chillow.model.action import Action
from chillow.model.game import Game
from chillow.model.player import Player
from chillow.service.gam... | true | true |
f709e817f4713e92e5114cefb9a40115888b3a18 | 16,977 | py | Python | kivy/tests/common.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 1 | 2019-10-04T00:27:02.000Z | 2019-10-04T00:27:02.000Z | kivy/tests/common.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 1 | 2019-10-08T02:06:27.000Z | 2019-10-08T02:06:27.000Z | kivy/tests/common.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | null | null | null | '''
This is a extended unittest module for Kivy, to make unittests based on
graphics with an OpenGL context.
The idea is to render a Widget tree, and after 1, 2 or more frames, a
screenshot will be made and be compared to the original one.
If no screenshot exists for the current test, the very first one will be used.
... | 34.646939 | 79 | 0.569594 |
__all__ = ('GraphicUnitTest', 'UnitTestTouch', 'UTMotionEvent', 'async_run')
import unittest
import logging
import pytest
import sys
import os
import threading
from kivy.graphics.cgl import cgl_get_backend_name
from kivy.input.motionevent import MotionEvent
log = logging.getLogger('unittest')
_base = object
if 'moc... | true | true |
f709e8cded7e066c6f95bc28fa79965b97ba66d5 | 160 | py | Python | minecraft_remapper/__init__.py | Nearata/minecraft-remapper | 502a26f3f90c926554976b1f2ad0a82b236c7a96 | [
"MIT"
] | 1 | 2021-01-24T22:05:51.000Z | 2021-01-24T22:05:51.000Z | minecraft_remapper/__init__.py | Nearata/minecraft-remapper | 502a26f3f90c926554976b1f2ad0a82b236c7a96 | [
"MIT"
] | 4 | 2021-01-24T22:11:24.000Z | 2021-08-15T21:16:53.000Z | minecraft_remapper/__init__.py | Nearata/minecraft-remapper | 502a26f3f90c926554976b1f2ad0a82b236c7a96 | [
"MIT"
] | null | null | null | """A Minecraft remapper for already deobfuscated forge mod source code."""
__version__ = "1.1.0"
from minecraft_remapper.remapper import Remapper as Remapper
| 26.666667 | 74 | 0.7875 |
__version__ = "1.1.0"
from minecraft_remapper.remapper import Remapper as Remapper
| true | true |
f709e9abdda917983a56be8d0236370b06343eef | 1,997 | py | Python | bluebottle/payments_vitepay/migrations/0001_initial.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/payments_vitepay/migrations/0001_initial.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/payments_vitepay/migrations/0001_initial.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-10-13 15:51
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('payments', '0002_auto_20160718_2345'),
... | 44.377778 | 194 | 0.597897 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('payments', '0002_auto_20160718_2345'),
]
operations = [
migrations.CreateModel(
n... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.