hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c079c35d5d34be98c06b62b40e5f46776a665a1 | 45 | py | Python | RFEM/dataTypes.py | r0m30d4c/DlubalRFEM6 | 4bd0d744007bdc27d86d6ce535a507cdc81552ca | [
"MIT"
] | null | null | null | RFEM/dataTypes.py | r0m30d4c/DlubalRFEM6 | 4bd0d744007bdc27d86d6ce535a507cdc81552ca | [
"MIT"
] | null | null | null | RFEM/dataTypes.py | r0m30d4c/DlubalRFEM6 | 4bd0d744007bdc27d86d6ce535a507cdc81552ca | [
"MIT"
] | null | null | null | # Specific data types
inf = float('inf')
| 11.25 | 22 | 0.622222 |
inf = float('inf')
| true | true |
1c079c39a418bf0c7a8a1563ad17a5c387518678 | 1,176 | py | Python | JumpscaleCore/data/schema/tests/12_enums.py | gneumann333/jumpscaleX_core | 777d249fa3668c6e802c2f765f4b82fb39c3e5fa | [
"Apache-2.0"
] | 1 | 2020-06-21T11:18:52.000Z | 2020-06-21T11:18:52.000Z | JumpscaleCore/data/schema/tests/12_enums.py | gneumann333/jumpscaleX_core | 777d249fa3668c6e802c2f765f4b82fb39c3e5fa | [
"Apache-2.0"
] | 644 | 2019-08-25T10:19:56.000Z | 2020-12-23T09:41:04.000Z | JumpscaleCore/data/schema/tests/12_enums.py | gneumann333/jumpscaleX_core | 777d249fa3668c6e802c2f765f4b82fb39c3e5fa | [
"Apache-2.0"
] | 11 | 2019-08-29T21:38:50.000Z | 2020-06-21T11:18:55.000Z | from Jumpscale import j
def test_enums():
"""
to run:
kosmos 'j.data.schema.test(name="enums")'
"""
j.data.schema.reset()
schema_text1 = """
@url = schema.test.enums1
status = "init,config,installed" (E)
category = 1,2,3 (E)
"""
s1 = j.data.schema.get_from_text(schema_text... | 22.188679 | 101 | 0.596939 | from Jumpscale import j
def test_enums():
j.data.schema.reset()
schema_text1 = """
@url = schema.test.enums1
status = "init,config,installed" (E)
category = 1,2,3 (E)
"""
s1 = j.data.schema.get_from_text(schema_text1)
schema_text2 = """
@url = schema.test.enums2
status = "halt... | true | true |
1c079c3e5c3a6ea006e72816b5c459be6a7d6a4c | 1,108 | py | Python | src/base/migrations/0001_initial.py | JulianBritos/Actividadfinal | a63cece34496dd46a2db67e4b1f0a1ce4882789d | [
"MIT"
] | null | null | null | src/base/migrations/0001_initial.py | JulianBritos/Actividadfinal | a63cece34496dd46a2db67e4b1f0a1ce4882789d | [
"MIT"
] | null | null | null | src/base/migrations/0001_initial.py | JulianBritos/Actividadfinal | a63cece34496dd46a2db67e4b1f0a1ce4882789d | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2022-02-03 10:57
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(... | 35.741935 | 173 | 0.575812 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='Tarea',
fields=... | true | true |
1c079c92db5c00412e270886ce9560b87b0b57ba | 5,911 | py | Python | Final Project/Model/main.py | mahmlk/ENSF619.2_Assignments | e1cff2159a23f3482e632cd460ac8d14c60f365e | [
"MIT"
] | null | null | null | Final Project/Model/main.py | mahmlk/ENSF619.2_Assignments | e1cff2159a23f3482e632cd460ac8d14c60f365e | [
"MIT"
] | null | null | null | Final Project/Model/main.py | mahmlk/ENSF619.2_Assignments | e1cff2159a23f3482e632cd460ac8d14c60f365e | [
"MIT"
] | null | null | null | from __future__ import print_function
import torch, os, copy, time, pickle
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision
from torchvision import datasets, transforms
from torch.autograd import Variable
import matplotlib.pyplot as plt
import numpy as np
from PIL imp... | 33.39548 | 158 | 0.698697 | from __future__ import print_function
import torch, os, copy, time, pickle
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision
from torchvision import datasets, transforms
from torch.autograd import Variable
import matplotlib.pyplot as plt
import numpy as np
from PIL imp... | true | true |
1c079ca7177173d0c07e8c49ca18023282012d8a | 731 | py | Python | FPGA/HCTestiing/DecompressorTests/cleanPcap.py | CSEYJ/Flightplan | e1424f42c8f06446094941c38ef5989a76b7ee0a | [
"Apache-2.0"
] | 20 | 2020-10-06T08:37:22.000Z | 2022-03-28T07:32:23.000Z | FPGA/HCTestiing/DecompressorTests/cleanPcap.py | CSEYJ/Flightplan | e1424f42c8f06446094941c38ef5989a76b7ee0a | [
"Apache-2.0"
] | 1 | 2021-01-24T15:51:40.000Z | 2021-01-24T15:51:40.000Z | FPGA/HCTestiing/DecompressorTests/cleanPcap.py | CSEYJ/Flightplan | e1424f42c8f06446094941c38ef5989a76b7ee0a | [
"Apache-2.0"
] | 3 | 2021-01-06T03:43:50.000Z | 2021-10-15T20:09:32.000Z | """
Generate pcaps for testing compressor / decompressor functionality.
"""
import sys, time, random, socket, os, struct
import threading
import binascii
import dpkt
import subprocess
def main(pcapF1):
cleanPcaps(pcapF1)
def cleanPcaps(pcapF1):
pcap1 = dpkt.pcap.Reader(open(pcapF1))
pcap2 = dpkt.pcap.Writer(open("... | 22.151515 | 67 | 0.712722 | import sys, time, random, socket, os, struct
import threading
import binascii
import dpkt
import subprocess
def main(pcapF1):
cleanPcaps(pcapF1)
def cleanPcaps(pcapF1):
pcap1 = dpkt.pcap.Reader(open(pcapF1))
pcap2 = dpkt.pcap.Writer(open("clean.pcap", "w+"))
pcap1Bufs = []
for ts, buf in pcap1:
eth = dpkt.ethe... | true | true |
1c079cf441f759fcbf89dc7f2ef9669c2b2a354d | 92 | py | Python | boto3_type_annotations_with_docs/boto3_type_annotations/opsworkscm/__init__.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 119 | 2018-12-01T18:20:57.000Z | 2022-02-02T10:31:29.000Z | boto3_type_annotations_with_docs/boto3_type_annotations/opsworkscm/__init__.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 15 | 2018-11-16T00:16:44.000Z | 2021-11-13T03:44:18.000Z | boto3_type_annotations_with_docs/boto3_type_annotations/opsworkscm/__init__.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 11 | 2019-05-06T05:26:51.000Z | 2021-09-28T15:27:59.000Z | from boto3_type_annotations.opsworkscm.client import Client
__all__ = (
'Client'
)
| 15.333333 | 59 | 0.728261 | from boto3_type_annotations.opsworkscm.client import Client
__all__ = (
'Client'
)
| true | true |
1c079d1a6012c4c5b73863dcceaf672c02f3c226 | 6,362 | py | Python | imblearn/under_sampling/_prototype_generation/_cluster_centroids.py | laurallu/imbalanced-learn | 321b751f90ef8faaec6b39218f8c531893e9e79f | [
"MIT"
] | null | null | null | imblearn/under_sampling/_prototype_generation/_cluster_centroids.py | laurallu/imbalanced-learn | 321b751f90ef8faaec6b39218f8c531893e9e79f | [
"MIT"
] | null | null | null | imblearn/under_sampling/_prototype_generation/_cluster_centroids.py | laurallu/imbalanced-learn | 321b751f90ef8faaec6b39218f8c531893e9e79f | [
"MIT"
] | null | null | null | """Class to perform under-sampling by generating centroids based on
clustering."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Fernando Nogueira
# Christos Aridas
# License: MIT
import numpy as np
from scipy import sparse
from sklearn.base import clone
from sklearn.cluster import KMean... | 35.149171 | 79 | 0.625589 |
import numpy as np
from scipy import sparse
from sklearn.base import clone
from sklearn.cluster import KMeans
from sklearn.neighbors import NearestNeighbors
from sklearn.utils import _safe_indexing
from ..base import BaseUnderSampler
from ...utils import Substitution
from ...utils._docstring import _random_state_do... | true | true |
1c079d6a6263b09b208a7be392f8d89b7dee9cc9 | 1,084 | py | Python | gui/company_listbox.py | keremkoseoglu/Kifu | bed7a15f71e2345c654b1adab07a5edecdbae342 | [
"MIT"
] | null | null | null | gui/company_listbox.py | keremkoseoglu/Kifu | bed7a15f71e2345c654b1adab07a5edecdbae342 | [
"MIT"
] | 82 | 2020-06-25T09:45:01.000Z | 2022-03-31T09:35:31.000Z | gui/company_listbox.py | keremkoseoglu/Kifu | bed7a15f71e2345c654b1adab07a5edecdbae342 | [
"MIT"
] | null | null | null | """ Company list box control """
import tkinter
from typing import List
from model.company import Company
class CompanyListbox:
""" Company list box control """
def __init__(self,
parent: tkinter.Toplevel,
x_pos: int,
y_pos: int,
companies: ... | 29.297297 | 74 | 0.594096 | import tkinter
from typing import List
from model.company import Company
class CompanyListbox:
def __init__(self,
parent: tkinter.Toplevel,
x_pos: int,
y_pos: int,
companies: List[Company] = None):
self._combo_val = []
if compan... | true | true |
1c079ff27c82b255fee582ac8bf89aa93a6fc257 | 3,993 | py | Python | scrapy/spiders/__init__.py | gustavo-bordin/scrapy | e7d3fad00eab9aaeedf8896739e969db92c1e408 | [
"BSD-3-Clause"
] | null | null | null | scrapy/spiders/__init__.py | gustavo-bordin/scrapy | e7d3fad00eab9aaeedf8896739e969db92c1e408 | [
"BSD-3-Clause"
] | null | null | null | scrapy/spiders/__init__.py | gustavo-bordin/scrapy | e7d3fad00eab9aaeedf8896739e969db92c1e408 | [
"BSD-3-Clause"
] | null | null | null | """
Base class for Scrapy spiders
See documentation in docs/topics/spiders.rst
"""
import logging
import warnings
from typing import Optional
from scrapy import signals
from scrapy.http import Request
from scrapy.utils.trackref import object_ref
from scrapy.utils.url import url_is_from_spider
from scrapy.utils.deprec... | 34.128205 | 93 | 0.646131 | import logging
import warnings
from typing import Optional
from scrapy import signals
from scrapy.http import Request
from scrapy.utils.trackref import object_ref
from scrapy.utils.url import url_is_from_spider
from scrapy.utils.deprecate import method_is_overridden
class Spider(object_ref):
name: Optional[str]... | true | true |
1c07a063372e8a5c6a5057db91970b18c87aaf65 | 1,536 | py | Python | pyos/task.py | nuaalixu/pyos | ab9173acb3fc11f1a7ab34633bc315a053344d42 | [
"MIT"
] | null | null | null | pyos/task.py | nuaalixu/pyos | ab9173acb3fc11f1a7ab34633bc315a053344d42 | [
"MIT"
] | null | null | null | pyos/task.py | nuaalixu/pyos | ab9173acb3fc11f1a7ab34633bc315a053344d42 | [
"MIT"
] | null | null | null | """A task is a wrapper around a coroutine."""
from typing import Generator
from pyos.systemcall import SystemCall
class Task(object):
"""This object encapsulates a running task."""
taskid = 0
def __init__(self,target):
Task.taskid += 1
self.tid = Task.taskid # Task ID
self... | 36.571429 | 99 | 0.538411 | from typing import Generator
from pyos.systemcall import SystemCall
class Task(object):
taskid = 0
def __init__(self,target):
Task.taskid += 1
self.tid = Task.taskid self.target = target self.sendval = None self.stack = []
... | true | true |
1c07a10d02c7c1f2f4611b84bb442827868a42b3 | 11,900 | py | Python | theano/tensor/nnet/ConvGrad3D.py | jych/Theano | d7d722faa96aac95c19f460bf60e8e8654ff58df | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/nnet/ConvGrad3D.py | jych/Theano | d7d722faa96aac95c19f460bf60e8e8654ff58df | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/nnet/ConvGrad3D.py | jych/Theano | d7d722faa96aac95c19f460bf60e8e8654ff58df | [
"BSD-3-Clause"
] | null | null | null | from six.moves import xrange
import numpy as N
import theano
from theano.tensor import basic as T
from theano.misc import strutil
from theano.gradient import grad_undefined
from theano.gradient import DisconnectedType
# TODO: speed up by reordering loops. Should pass through the videos once, incrementing all weight... | 42.65233 | 368 | 0.484706 | from six.moves import xrange
import numpy as N
import theano
from theano.tensor import basic as T
from theano.misc import strutil
from theano.gradient import grad_undefined
from theano.gradient import DisconnectedType
class ConvGrad3D(theano.Op):
__props__ = ()
def c_code_cache_version(self):
retu... | true | true |
1c07a1e7d453a1fbfa87ad04dc96c8a01ea0e462 | 9,471 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_nonlinear_software/14-19_10.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_nonlinear_software/14-19_10.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_nonlinear_software/14-19_10.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import FrozenSet, Tuple
import pysmt.typing as types
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 34.44 | 81 | 0.545771 | from typing import FrozenSet, Tuple
import pysmt.typing as types
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | true | true |
1c07a1e81dd5da44ffc09b82635039721d52a8e6 | 14,057 | py | Python | features/steps/color.py | eaton-lab/toyplot | 472f2f2f1bc048e485ade44d75c3ace310be4b41 | [
"BSD-3-Clause"
] | 438 | 2015-01-06T20:54:02.000Z | 2022-03-15T00:39:33.000Z | features/steps/color.py | eaton-lab/toyplot | 472f2f2f1bc048e485ade44d75c3ace310be4b41 | [
"BSD-3-Clause"
] | 184 | 2015-01-26T17:04:47.000Z | 2022-02-19T16:29:00.000Z | features/steps/color.py | eaton-lab/toyplot | 472f2f2f1bc048e485ade44d75c3ace310be4b41 | [
"BSD-3-Clause"
] | 45 | 2015-07-06T18:00:27.000Z | 2022-02-14T12:46:17.000Z | # Copyright 2014, Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain
# rights in this software.
from behave import *
import json
import nose.tools
import numpy
import toyplot.color
import testing
@when(u'toyplot.color.css receives {valu... | 34.453431 | 98 | 0.686775 |
from behave import *
import json
import nose.tools
import numpy
import toyplot.color
import testing
@when(u'toyplot.color.css receives {value}')
def step_impl(context, value):
context.value = value
@then(u'toyplot.color.css should return {value}')
def step_impl(context, value):
testing.assert_color_equa... | true | true |
1c07a276e9953975c61caf4375f5c801d1902ded | 1,823 | py | Python | Examples/python_client/test/test_af_event_exposure_data.py | H21lab/5GC_build | bbc8bbd9158a2124ca486572906020a91789733e | [
"Apache-2.0"
] | 12 | 2020-06-04T06:58:13.000Z | 2021-12-15T14:26:56.000Z | Examples/python_client/test/test_af_event_exposure_data.py | H21lab/5GC_build | bbc8bbd9158a2124ca486572906020a91789733e | [
"Apache-2.0"
] | 3 | 2021-05-27T12:13:58.000Z | 2021-12-15T05:45:44.000Z | Examples/python_client/test/test_af_event_exposure_data.py | H21lab/5GC_build | bbc8bbd9158a2124ca486572906020a91789733e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
NRF NFDiscovery Service
NRF NFDiscovery Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. # noqa: E501
The version of the OpenAPI document: 1.1.0.alpha-4
Generated by: https://openapi-generator.tech
"""
from __future_... | 28.484375 | 144 | 0.605595 |
from __future__ import absolute_import
import unittest
import datetime
import openapi_client
from openapi_client.com.h21lab.TS29510_Nnrf_NFDiscovery.handler.af_event_exposure_data import AfEventExposureData from openapi_client.rest import ApiException
class TestAfEventExposureData(unittest.TestCase):
def se... | true | true |
1c07a32607ed4a25b06f91d0d199af1a715a6e10 | 995 | py | Python | tests/dynamic_analysis/test_run_analysis_arm.py | jrespeto/LiSa | 1535b9c300b5dd9fbc82ba7988a79ed5954daa91 | [
"Apache-2.0"
] | 244 | 2019-04-16T13:36:10.000Z | 2022-03-30T23:53:01.000Z | tests/dynamic_analysis/test_run_analysis_arm.py | jrespeto/LiSa | 1535b9c300b5dd9fbc82ba7988a79ed5954daa91 | [
"Apache-2.0"
] | 25 | 2019-07-31T10:48:28.000Z | 2022-03-03T19:54:04.000Z | tests/dynamic_analysis/test_run_analysis_arm.py | jrespeto/LiSa | 1535b9c300b5dd9fbc82ba7988a79ed5954daa91 | [
"Apache-2.0"
] | 60 | 2019-04-17T00:59:28.000Z | 2022-03-03T19:33:24.000Z | """
Unit tests for full run_analysis with QEMU emulation.
"""
import os
import pytest
from lisa.analysis.dynamic_analysis import DynamicAnalyzer
from lisa.core.base import AnalyzedFile
location = os.path.dirname(__file__)
@pytest.fixture(scope='module')
def analysis():
return {'output': None}
def test_ru... | 24.268293 | 60 | 0.711558 |
import os
import pytest
from lisa.analysis.dynamic_analysis import DynamicAnalyzer
from lisa.core.base import AnalyzedFile
location = os.path.dirname(__file__)
@pytest.fixture(scope='module')
def analysis():
return {'output': None}
def test_run_analysis(analysis):
sample_path = f'{location}/../binaries/t... | true | true |
1c07a381bcde283167656db09d2576c6d8c3b378 | 878 | py | Python | api/src/validator/SampleSpeakValidator.py | SamuelJansen/ai-voice-api | 5752fb9b1287945c0b074687552b0fcb205ed27a | [
"MIT"
] | 2 | 2022-02-07T12:22:13.000Z | 2022-03-04T02:42:55.000Z | api/src/validator/SampleSpeakValidator.py | SamuelJansen/voice-api | 6e143e01ad3e06d4f836646f024d3ca06cb37efa | [
"MIT"
] | null | null | null | api/src/validator/SampleSpeakValidator.py | SamuelJansen/voice-api | 6e143e01ad3e06d4f836646f024d3ca06cb37efa | [
"MIT"
] | null | null | null | from python_helper import ObjectHelper, DateTimeHelper
from python_framework import Validator, ValidatorMethod, GlobalException, HttpStatus, EnumItem, ApiKeyManager
from dto import SampleSpeakDto
import SampleSpeak
@Validator()
class SampleSpeakValidator:
@ValidatorMethod(requestClass=[SampleSpeak.SampleSpeak, [... | 48.777778 | 212 | 0.733485 | from python_helper import ObjectHelper, DateTimeHelper
from python_framework import Validator, ValidatorMethod, GlobalException, HttpStatus, EnumItem, ApiKeyManager
from dto import SampleSpeakDto
import SampleSpeak
@Validator()
class SampleSpeakValidator:
@ValidatorMethod(requestClass=[SampleSpeak.SampleSpeak, [... | true | true |
1c07a52082168534b376992332e58df09a88113e | 2,214 | py | Python | lists/update_list_test.py | bluPhy/api-samples-python | de50f715e9fee8e29626ba26eb9c5abae54e7827 | [
"Apache-2.0"
] | 10 | 2020-02-13T22:05:00.000Z | 2020-06-17T17:38:49.000Z | lists/update_list_test.py | bluPhy/api-samples-python | de50f715e9fee8e29626ba26eb9c5abae54e7827 | [
"Apache-2.0"
] | 7 | 2020-09-15T21:46:52.000Z | 2021-01-12T05:57:48.000Z | lists/update_list_test.py | bluPhy/api-samples-python | de50f715e9fee8e29626ba26eb9c5abae54e7827 | [
"Apache-2.0"
] | 10 | 2021-05-07T19:31:11.000Z | 2022-03-16T20:09:34.000Z | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 36.295082 | 74 | 0.728997 |
import unittest
from unittest import mock
from google.auth.transport import requests
from . import update_list
class UpdateListTest(unittest.TestCase):
@mock.patch.object(requests, "AuthorizedSession", autospec=True)
@mock.patch.object(requests.requests, "Response", autospec=True)
def test_http_error(self, ... | true | true |
1c07a571acf82e1480a83330012241de853124ee | 15,794 | py | Python | Projet.py | PedroJacobino/Pygame-Penalty-Kick | 8d5b213eb9dd92346fff6cf162a9a0dda67d805b | [
"MIT"
] | null | null | null | Projet.py | PedroJacobino/Pygame-Penalty-Kick | 8d5b213eb9dd92346fff6cf162a9a0dda67d805b | [
"MIT"
] | null | null | null | Projet.py | PedroJacobino/Pygame-Penalty-Kick | 8d5b213eb9dd92346fff6cf162a9a0dda67d805b | [
"MIT"
] | null | null | null | import pygame
import os
import random
from Objets import *
intro = Intro()
score = 0
gardien_pris = 0
isolé = 0
tentatives = 0
fps = 30
Tutorial = True
reiniciar = True
Introduction = True # Pour faire l'intro
InterfaceTutoriel = 0
running = True
son = False
infini = False
# Initialize pygame and c... | 38.805897 | 145 | 0.528049 | import pygame
import os
import random
from Objets import *
intro = Intro()
score = 0
gardien_pris = 0
isolé = 0
tentatives = 0
fps = 30
Tutorial = True
reiniciar = True
Introduction = True InterfaceTutoriel = 0
running = True
son = False
infini = False
# Initialize pygame and create window
pygame... | true | true |
1c07a5d24d910af86e81d533f707075d13f3b6b4 | 5,766 | py | Python | backend/event/migrations/0001_initial.py | crowdbotics-apps/sol-association-28653 | 42a7b2194569ba7dba0cf49544e647a2e60a0d43 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/event/migrations/0001_initial.py | crowdbotics-apps/sol-association-28653 | 42a7b2194569ba7dba0cf49544e647a2e60a0d43 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/event/migrations/0001_initial.py | crowdbotics-apps/sol-association-28653 | 42a7b2194569ba7dba0cf49544e647a2e60a0d43 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | # Generated by Django 2.2.24 on 2021-07-09 04:11
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
op... | 51.482143 | 175 | 0.591398 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
1c07a6c6de6b0001808a8fbee83425b3d16da8f6 | 1,618 | py | Python | reinvent_models/link_invent/networks/attention_layer.py | GT4SD/-reinvent_models | e1cf00d1b24fe5f39354e34829adc25460da84e2 | [
"MIT"
] | null | null | null | reinvent_models/link_invent/networks/attention_layer.py | GT4SD/-reinvent_models | e1cf00d1b24fe5f39354e34829adc25460da84e2 | [
"MIT"
] | 1 | 2022-03-07T12:18:00.000Z | 2022-03-07T12:18:00.000Z | reinvent_models/link_invent/networks/attention_layer.py | GT4SD/reinvent_models | e1cf00d1b24fe5f39354e34829adc25460da84e2 | [
"MIT"
] | null | null | null | import math
import torch
from torch import nn as tnn
class AttentionLayer(tnn.Module):
def __init__(self, num_dimensions: int):
super(AttentionLayer, self).__init__()
self.num_dimensions = num_dimensions
self._attention_linear = tnn.Sequential(
tnn.Linear(self... | 42.578947 | 114 | 0.646477 | import math
import torch
from torch import nn as tnn
class AttentionLayer(tnn.Module):
def __init__(self, num_dimensions: int):
super(AttentionLayer, self).__init__()
self.num_dimensions = num_dimensions
self._attention_linear = tnn.Sequential(
tnn.Linear(self... | true | true |
1c07a728abcec6be74da3644282189018549d0ae | 2,659 | py | Python | apps/controllerx/cx_core/integration/z2m.py | francoisauclair911/controllerx | 00b38cdbddb75e470d1577f1d22c8e99d62e1256 | [
"MIT"
] | null | null | null | apps/controllerx/cx_core/integration/z2m.py | francoisauclair911/controllerx | 00b38cdbddb75e470d1577f1d22c8e99d62e1256 | [
"MIT"
] | null | null | null | apps/controllerx/cx_core/integration/z2m.py | francoisauclair911/controllerx | 00b38cdbddb75e470d1577f1d22c8e99d62e1256 | [
"MIT"
] | null | null | null | import json
from typing import Optional
from appdaemon.plugins.hass.hassapi import Hass
from appdaemon.plugins.mqtt.mqttapi import Mqtt
from cx_const import DefaultActionsMapping
from cx_core.integration import EventData, Integration
LISTENS_TO_HA = "ha"
LISTENS_TO_MQTT = "mqtt"
class Z2MIntegration(Integration):
... | 36.930556 | 88 | 0.610756 | import json
from typing import Optional
from appdaemon.plugins.hass.hassapi import Hass
from appdaemon.plugins.mqtt.mqttapi import Mqtt
from cx_const import DefaultActionsMapping
from cx_core.integration import EventData, Integration
LISTENS_TO_HA = "ha"
LISTENS_TO_MQTT = "mqtt"
class Z2MIntegration(Integration):
... | true | true |
1c07a753c65f1eaa0be57ce9dcc41feadad30b9a | 2,059 | py | Python | src/openpersonen/converters/stufbg2api/tests.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | 2 | 2020-08-26T11:24:43.000Z | 2021-07-28T09:46:40.000Z | src/openpersonen/converters/stufbg2api/tests.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | 153 | 2020-08-26T10:45:35.000Z | 2021-12-10T17:33:16.000Z | src/openpersonen/converters/stufbg2api/tests.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | null | null | null | from django.template import loader
from django.urls import reverse
from rest_framework.test import APITestCase
from openpersonen.utils.instance_dicts import (
convert_xml_to_kind_dict,
convert_xml_to_ouder_dict,
convert_xml_to_partner_dict,
convert_xml_to_persoon_dicts,
)
class TestPersoonView(APITe... | 28.205479 | 85 | 0.643516 | from django.template import loader
from django.urls import reverse
from rest_framework.test import APITestCase
from openpersonen.utils.instance_dicts import (
convert_xml_to_kind_dict,
convert_xml_to_ouder_dict,
convert_xml_to_partner_dict,
convert_xml_to_persoon_dicts,
)
class TestPersoonView(APITe... | true | true |
1c07ab504554ef12be5861bc7b25940aa8363407 | 703 | py | Python | contactmps/migrations/0034_auto_20180530_1115.py | OpenUpSA/contact-mps | 63d7f86e1b6c9319a4d0344a6125cd22770f34c7 | [
"MIT"
] | null | null | null | contactmps/migrations/0034_auto_20180530_1115.py | OpenUpSA/contact-mps | 63d7f86e1b6c9319a4d0344a6125cd22770f34c7 | [
"MIT"
] | 12 | 2017-06-08T09:36:49.000Z | 2021-06-10T18:48:08.000Z | contactmps/migrations/0034_auto_20180530_1115.py | OpenUpSA/contact-mps | 63d7f86e1b6c9319a4d0344a6125cd22770f34c7 | [
"MIT"
] | 2 | 2017-07-17T15:14:25.000Z | 2020-06-22T02:08:58.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-05-30 11:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contactmps', '0033_auto_20180521_1341'),
]
operations = [
migrations.AddFie... | 27.038462 | 102 | 0.621622 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contactmps', '0033_auto_20180521_1341'),
]
operations = [
migrations.AddField(
model_name='email',
name='is_sent',
... | true | true |
1c07ad083ae7cba6fa5651ed38e22e7257f657fe | 403 | py | Python | tests/pyre.pkg/primitives/sanity.py | avalentino/pyre | 7e1f0287eb7eba1c6d1ef385e5160079283ac363 | [
"BSD-3-Clause"
] | 25 | 2018-04-23T01:45:39.000Z | 2021-12-10T06:01:23.000Z | tests/pyre.pkg/primitives/sanity.py | avalentino/pyre | 7e1f0287eb7eba1c6d1ef385e5160079283ac363 | [
"BSD-3-Clause"
] | 53 | 2018-05-31T04:55:00.000Z | 2021-10-07T21:41:32.000Z | tests/pyre.pkg/primitives/sanity.py | avalentino/pyre | 7e1f0287eb7eba1c6d1ef385e5160079283ac363 | [
"BSD-3-Clause"
] | 12 | 2018-04-23T22:50:40.000Z | 2022-02-20T17:27:23.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2021 all rights reserved
#
"""
Sanity check: verify that the package is accessible
"""
def test():
import pyre.primitives
return
# main
if __name__ == "__main__":
# skip pyre initialization since we don't r... | 13.896552 | 67 | 0.637717 |
def test():
import pyre.primitives
return
if __name__ == "__main__":
pyre_noboot = True
# do...
test()
# end of file
| true | true |
1c07ad0b743cc64d25b35d571d53186409b90b4f | 981 | py | Python | multirunnable/concurrent/context.py | Chisanan232/multirunnable | 7223e49750dc3d3ccf7ebcd3d292138916b582f2 | [
"Apache-2.0"
] | 1 | 2022-03-18T15:20:53.000Z | 2022-03-18T15:20:53.000Z | multirunnable/concurrent/context.py | Chisanan232/multirunnable | 7223e49750dc3d3ccf7ebcd3d292138916b582f2 | [
"Apache-2.0"
] | null | null | null | multirunnable/concurrent/context.py | Chisanan232/multirunnable | 7223e49750dc3d3ccf7ebcd3d292138916b582f2 | [
"Apache-2.0"
] | null | null | null | from typing import List
from threading import current_thread, main_thread, active_count, enumerate, Thread
from ..framework.runnable.context import BaseContext
class context(BaseContext):
@staticmethod
def get_current_worker() -> Thread:
return current_thread()
@staticmethod
def get_paren... | 20.020408 | 82 | 0.681957 | from typing import List
from threading import current_thread, main_thread, active_count, enumerate, Thread
from ..framework.runnable.context import BaseContext
class context(BaseContext):
@staticmethod
def get_current_worker() -> Thread:
return current_thread()
@staticmethod
def get_paren... | true | true |
1c07ae16a2dd802b1735caa2a70264b84b6ffdf0 | 702 | py | Python | google/ads/googleads/v9/services/services/customizer_attribute_service/__init__.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/services/services/customizer_attribute_service/__init__.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/services/services/customizer_attribute_service/__init__.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 36.947368 | 74 | 0.762108 | from .client import CustomizerAttributeServiceClient
__all__ = ("CustomizerAttributeServiceClient",)
| true | true |
1c07af0842984a0567c8a95a1695f364a45f77be | 3,525 | py | Python | download_eraint_from_ecmwf.py | fmidev/predict_lightnings | 5530dd96c6d98542f294ec95d1c01ee918d68fd3 | [
"MIT"
] | null | null | null | download_eraint_from_ecmwf.py | fmidev/predict_lightnings | 5530dd96c6d98542f294ec95d1c01ee918d68fd3 | [
"MIT"
] | null | null | null | download_eraint_from_ecmwf.py | fmidev/predict_lightnings | 5530dd96c6d98542f294ec95d1c01ee918d68fd3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
#
import os, sys
from ecmwfapi import ECMWFDataServer
# To run this example, you need an API key
# available from https://api.ecmwf.int/v1/key/
server = ECMWFDataServer()
# Variable key from command line arguments
varname = str(sys.argv[1])
# Directories from command line arguments
cod... | 42.46988 | 115 | 0.429504 |
import os, sys
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()
varname = str(sys.argv[1])
codir, indir, oudir = str(sys.argv[2]), str(sys.argv[3]), str(sys.argv[4])
name2code = {'pmsl': ["151", "an", "sfc", "0", "00/06/12/18", "0"],
'psfc': ["134", "an", "... | true | true |
1c07af843bb9687e25064d5729554d4c0a1d33aa | 10,967 | py | Python | src/twisted/web/_stan.py | giadram/twisted | 4771b1340b822d20d0664bb7d8334e8fb7e52863 | [
"MIT",
"Unlicense"
] | null | null | null | src/twisted/web/_stan.py | giadram/twisted | 4771b1340b822d20d0664bb7d8334e8fb7e52863 | [
"MIT",
"Unlicense"
] | null | null | null | src/twisted/web/_stan.py | giadram/twisted | 4771b1340b822d20d0664bb7d8334e8fb7e52863 | [
"MIT",
"Unlicense"
] | null | null | null | # -*- test-case-name: twisted.web.test.test_stan -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An s-expression-like syntax for expressing xml in pure python.
Stan tags allow you to build XML documents using Python.
Stan is a DOM, or Document Object Model, implemented using basic Pyt... | 30.379501 | 102 | 0.611653 |
from inspect import isgenerator, iscoroutine
from typing import TYPE_CHECKING, Dict, List, Optional, Union
from warnings import warn
import attr
if TYPE_CHECKING:
from twisted.web.template import Flattenable
@attr.s(hash=False, eq=False, auto_attribs=True)
class slot:
name: str
children: List["Tag"... | true | true |
1c07b1b250b6bc6d22a57b62fc7afdccbad8017f | 12,184 | py | Python | farmbot/farmbot.py | tmaziere/farmbot-py | 535ee38a13a677977721b3f12b2d20972e3550b4 | [
"MIT"
] | 1 | 2021-06-01T09:22:34.000Z | 2021-06-01T09:22:34.000Z | farmbot/farmbot.py | tmaziere/farmbot-py | 535ee38a13a677977721b3f12b2d20972e3550b4 | [
"MIT"
] | null | null | null | farmbot/farmbot.py | tmaziere/farmbot-py | 535ee38a13a677977721b3f12b2d20972e3550b4 | [
"MIT"
] | null | null | null | import paho.mqtt.client as mqtt
from urllib.request import urlopen, Request
import json
import uuid
class OkResponse():
def __init__(self, id):
self.id = id
class ErrorResponse():
def __init__(self, id, errors):
self.errors = errors
self.id = id
class FarmbotConnection():
def _... | 30.46 | 87 | 0.54867 | import paho.mqtt.client as mqtt
from urllib.request import urlopen, Request
import json
import uuid
class OkResponse():
def __init__(self, id):
self.id = id
class ErrorResponse():
def __init__(self, id, errors):
self.errors = errors
self.id = id
class FarmbotConnection():
def _... | true | true |
1c07b22ce2ca80410433378ead8d38922f699d20 | 1,096 | py | Python | model/encoder/CNNEncoder.py | xcjthu/DisputeMJJD | bfc33da517e472ff7b8d58c8fd3ffbf5d71388a4 | [
"MIT"
] | 1 | 2021-04-09T20:36:43.000Z | 2021-04-09T20:36:43.000Z | model/encoder/CNNEncoder.py | xcjthu/DisputeMJJD | bfc33da517e472ff7b8d58c8fd3ffbf5d71388a4 | [
"MIT"
] | null | null | null | model/encoder/CNNEncoder.py | xcjthu/DisputeMJJD | bfc33da517e472ff7b8d58c8fd3ffbf5d71388a4 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
class CNNEncoder(nn.Module):
def __init__(self, config, gpu_list, *args, **params):
super(CNNEncoder, self).__init__()
self.emb_dim = config.getint("model", "hidden_Size")
self.output_dim = self.emb_dim // 4
... | 27.4 | 80 | 0.553832 | import torch
import torch.nn as nn
import torch.nn.functional as F
class CNNEncoder(nn.Module):
def __init__(self, config, gpu_list, *args, **params):
super(CNNEncoder, self).__init__()
self.emb_dim = config.getint("model", "hidden_Size")
self.output_dim = self.emb_dim // 4
... | true | true |
1c07b295e10c08e7228aa1ec6fb2b3677497e104 | 3,162 | py | Python | src/source/test_cleaning.py | hinha/kalkula-extension | 57163eaf55d0a734e65afe8af6bb35fe07c03b55 | [
"MIT"
] | null | null | null | src/source/test_cleaning.py | hinha/kalkula-extension | 57163eaf55d0a734e65afe8af6bb35fe07c03b55 | [
"MIT"
] | null | null | null | src/source/test_cleaning.py | hinha/kalkula-extension | 57163eaf55d0a734e65afe8af6bb35fe07c03b55 | [
"MIT"
] | null | null | null | import unittest
import hashlib
from . import cleaning
def FILE(file_name):
# Open,close, read file and calculate MD5 on its contents
prop = b""
readable_hash = hashlib.md5()
with open(".data/" + file_name, "rb") as f:
prop += bytearray(f.read())
for byte_block in iter(lambda: f.read(4... | 31.939394 | 83 | 0.626502 | import unittest
import hashlib
from . import cleaning
def FILE(file_name):
prop = b""
readable_hash = hashlib.md5()
with open(".data/" + file_name, "rb") as f:
prop += bytearray(f.read())
for byte_block in iter(lambda: f.read(4096), b""):
readable_hash.update(byte_block)
... | true | true |
1c07b38ca9ccd6de958afbfa581fc6ed57d83a1f | 2,930 | py | Python | appengine/isolate/mapreduce_jobs.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | null | null | null | appengine/isolate/mapreduce_jobs.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | null | null | null | appengine/isolate/mapreduce_jobs.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | 1 | 2021-12-06T03:37:36.000Z | 2021-12-06T03:37:36.000Z | # Copyright 2013 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Map reduce jobs to update the DB schemas or any other maintenance task."""
import logging
import os
import sys
# Map-reduce library expects 'mapredu... | 31.505376 | 80 | 0.732423 |
import logging
import os
import sys
ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(ROOT_DIR, 'third_party'))
from mapreduce import control
from mapreduce import main
import config
import gcs
MAPREDUCE_TASK_QUEUE = 'mapreduce-jobs'
MAPREDUCE_JOBS = {
'find_missing_gs_files'... | true | true |
1c07b41bafbf8b604bb5078049606286e293c7ab | 3,826 | py | Python | src/counterfactual_explanation/flow_ssl/data/nlp_datasets.py | tridungduong16/fairCE | b13c72c253d875e68c0294b91aaddcbf93460d92 | [
"MIT"
] | null | null | null | src/counterfactual_explanation/flow_ssl/data/nlp_datasets.py | tridungduong16/fairCE | b13c72c253d875e68c0294b91aaddcbf93460d92 | [
"MIT"
] | null | null | null | src/counterfactual_explanation/flow_ssl/data/nlp_datasets.py | tridungduong16/fairCE | b13c72c253d875e68c0294b91aaddcbf93460d92 | [
"MIT"
] | null | null | null | import os.path
import numpy as np
import torch
from torch.utils.data import Dataset
import subprocess
GDRIVE_DOWNLOAD = lambda FID,FNAME: f"wget --load-cookies /tmp/cookies.txt \"https://docs.google.com/uc?export=download&confirm=$(wget\
--quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check... | 40.273684 | 135 | 0.651594 | import os.path
import numpy as np
import torch
from torch.utils.data import Dataset
import subprocess
GDRIVE_DOWNLOAD = lambda FID,FNAME: f"wget --load-cookies /tmp/cookies.txt \"https://docs.google.com/uc?export=download&confirm=$(wget\
--quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check... | true | true |
1c07b50575be4fdc2c601445d128393009ad0495 | 148 | py | Python | src/synamic/__init__.py | SabujXi/SynamicX | 13773409ae5ed9b953b3531e23ce87166c041b79 | [
"MIT"
] | 7 | 2017-10-15T16:58:47.000Z | 2020-07-02T01:08:21.000Z | src/synamic/__init__.py | SabujXi/SynamicX | 13773409ae5ed9b953b3531e23ce87166c041b79 | [
"MIT"
] | 5 | 2021-03-18T20:30:32.000Z | 2022-03-11T23:20:09.000Z | src/synamic/__init__.py | SabujXi/SynamicX | 13773409ae5ed9b953b3531e23ce87166c041b79 | [
"MIT"
] | 2 | 2018-02-04T14:03:38.000Z | 2018-02-04T15:25:59.000Z | from .core.standalones.classes.nil import Nil
from .core.synamic import Synamic
import builtins
# add Nil to builtins
builtins.Nil = Nil
| 16.444444 | 46 | 0.743243 | from .core.standalones.classes.nil import Nil
from .core.synamic import Synamic
import builtins
builtins.Nil = Nil
| true | true |
1c07b61434e0758572c6ce417e07d322d0a4164a | 5,801 | py | Python | python/atomix/primitive/value/v1/__init__.py | atomix/api | 6f9bd1d5bdfb2546878d300ed4be7fe30678c165 | [
"Apache-2.0"
] | 1 | 2019-05-30T13:39:28.000Z | 2019-05-30T13:39:28.000Z | python/atomix/primitive/value/v1/__init__.py | atomix/api | 6f9bd1d5bdfb2546878d300ed4be7fe30678c165 | [
"Apache-2.0"
] | 2 | 2019-06-12T17:04:10.000Z | 2019-06-12T17:04:46.000Z | python/atomix/primitive/value/v1/__init__.py | atomix/atomix-api | 6f9bd1d5bdfb2546878d300ed4be7fe30678c165 | [
"Apache-2.0"
] | 2 | 2020-01-24T16:59:35.000Z | 2021-04-01T21:55:52.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: atomix/primitive/value/v1/manager.proto, atomix/primitive/value/v1/primitive.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import AsyncIterator, List, Optional
import betterproto
import grpclib
class ValueCacheSt... | 26.130631 | 93 | 0.678159 | from dataclasses import dataclass
from typing import AsyncIterator, List, Optional
import betterproto
import grpclib
class ValueCacheStrategy(betterproto.Enum):
NEAR = 0
READ_THROUGH = 1
WRITE_THROUGH = 2
READ_THROUGH_WRITE_THROUGH = 3
class EventType(betterproto.Enum):
NONE = 0
UPDATE = 1
... | true | true |
1c07b7410d127a4b2445e81a691b4d70d922033b | 499 | py | Python | ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/amazon/_ec2_vpc.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 1 | 2019-04-16T21:23:15.000Z | 2019-04-16T21:23:15.000Z | ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/amazon/_ec2_vpc.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 5 | 2020-02-26T20:10:50.000Z | 2021-09-23T23:23:18.000Z | ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/amazon/_ec2_vpc.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 1 | 2020-02-13T14:24:57.000Z | 2020-02-13T14:24:57.000Z | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['removed'],
... | 26.263158 | 92 | 0.691383 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['removed'],
'supported_by': 'certified'}
from ansible.module_utils.common.removed import removed_module
if __name__ == '__main__'... | true | true |
1c07b84ee059568ddaf52ecd90a4d4ab81bb3952 | 546 | py | Python | manage.py | Serchcode/encuesta | f261a57d1d3804deeb607745a53f7195ca6dc06b | [
"Apache-2.0"
] | null | null | null | manage.py | Serchcode/encuesta | f261a57d1d3804deeb607745a53f7195ca6dc06b | [
"Apache-2.0"
] | null | null | null | manage.py | Serchcode/encuesta | f261a57d1d3804deeb607745a53f7195ca6dc06b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "encuesta_celmi.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Djang... | 34.125 | 78 | 0.690476 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "encuesta_celmi.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's i... | true | true |
1c07b89ff29019fd1ffeb8723649250aba275056 | 1,030 | py | Python | glrm/reg.py | ammsa23/GLRM-1 | 459a1d2b579b048941387096118286267356f52b | [
"MIT"
] | null | null | null | glrm/reg.py | ammsa23/GLRM-1 | 459a1d2b579b048941387096118286267356f52b | [
"MIT"
] | null | null | null | glrm/reg.py | ammsa23/GLRM-1 | 459a1d2b579b048941387096118286267356f52b | [
"MIT"
] | null | null | null | from numpy.linalg import norm
from numpy import sign, Inf
from .util import shrinkage
import cvxpy as cp
"""
Abstract reg class and canonical regularizer functions.
"""
# Abstract Reg class
class Reg(object):
# shape indicates how quickly it grows: 0 [flat], 1 [linear], 2 [quadratic+]
def reg(self ): raise No... | 28.611111 | 84 | 0.691262 | from numpy.linalg import norm
from numpy import sign, Inf
from .util import shrinkage
import cvxpy as cp
class Reg(object):
def reg(self ): raise NotImplementedError("Override me!")
def __init__(self, nu=1): self.nu = nu def __str__(self): return "GLRM Reg: override me!"
def __call__(self, X): ret... | true | true |
1c07b920adb9b7ee69eb138bf90eac9f4df1d1fe | 30,179 | py | Python | python/ray/tests/test_placement_group.py | jseppanen/ray | 0c02427da25fe647c6e14d2390eae46aa5394f45 | [
"Apache-2.0"
] | 1 | 2020-11-09T04:14:58.000Z | 2020-11-09T04:14:58.000Z | python/ray/tests/test_placement_group.py | jseppanen/ray | 0c02427da25fe647c6e14d2390eae46aa5394f45 | [
"Apache-2.0"
] | null | null | null | python/ray/tests/test_placement_group.py | jseppanen/ray | 0c02427da25fe647c6e14d2390eae46aa5394f45 | [
"Apache-2.0"
] | null | null | null | import pytest
import os
import sys
try:
import pytest_timeout
except ImportError:
pytest_timeout = None
import ray
from ray.test_utils import (get_other_nodes, wait_for_condition,
get_error_message)
import ray.cluster_utils
from ray._raylet import PlacementGroupID
from ray.util.pla... | 31.08033 | 79 | 0.654528 | import pytest
import os
import sys
try:
import pytest_timeout
except ImportError:
pytest_timeout = None
import ray
from ray.test_utils import (get_other_nodes, wait_for_condition,
get_error_message)
import ray.cluster_utils
from ray._raylet import PlacementGroupID
from ray.util.pla... | true | true |
1c07b93a525f4313986287a4c403fe1496f0376e | 726 | py | Python | python/mnist/functions.py | ara-ta3/mnist | 5af3cc964145dc94cab3cc860819ea37717a346f | [
"MIT"
] | null | null | null | python/mnist/functions.py | ara-ta3/mnist | 5af3cc964145dc94cab3cc860819ea37717a346f | [
"MIT"
] | null | null | null | python/mnist/functions.py | ara-ta3/mnist | 5af3cc964145dc94cab3cc860819ea37717a346f | [
"MIT"
] | null | null | null | import numpy as np
def cross_entropy_error(y, t):
if y.ndim == 1:
t = t.reshape(1, t.size)
y = y.reshape(1, y.size)
if t.size == y.size:
t = t.argmax(axis=1)
batch_size = y.shape[0]
return -np.sum(np.log(y[np.arange(batch_size), t])) / batch_size
def numerical_gradient(f, x)... | 22 | 68 | 0.533058 | import numpy as np
def cross_entropy_error(y, t):
if y.ndim == 1:
t = t.reshape(1, t.size)
y = y.reshape(1, y.size)
if t.size == y.size:
t = t.argmax(axis=1)
batch_size = y.shape[0]
return -np.sum(np.log(y[np.arange(batch_size), t])) / batch_size
def numerical_gradient(f, x)... | true | true |
1c07ba9c2a29fb2b24b3424c004442323e63ab67 | 343 | py | Python | Tests/routen/app.py | WhereGroup/gml-parser | 186ffe36ec6cf7fd171fbb0ff5755bd6973e200b | [
"MIT"
] | null | null | null | Tests/routen/app.py | WhereGroup/gml-parser | 186ffe36ec6cf7fd171fbb0ff5755bd6973e200b | [
"MIT"
] | null | null | null | Tests/routen/app.py | WhereGroup/gml-parser | 186ffe36ec6cf7fd171fbb0ff5755bd6973e200b | [
"MIT"
] | null | null | null | import os
command ="ogr2ogr -f 'PostgreSQL' PG:'dbname=gml user=ransomware host=localhost port=5432' -nln 'trlp_%s' %s"
print "#!/bin/bash"
for root, dir, files in os.walk(u"."):
for gmlFile in files:
if gmlFile.endswith(".gml"):
print command % (gmlFile[:gmlFile.inde... | 34.3 | 111 | 0.594752 | import os
command ="ogr2ogr -f 'PostgreSQL' PG:'dbname=gml user=ransomware host=localhost port=5432' -nln 'trlp_%s' %s"
print "#!/bin/bash"
for root, dir, files in os.walk(u"."):
for gmlFile in files:
if gmlFile.endswith(".gml"):
print command % (gmlFile[:gmlFile.inde... | false | true |
1c07bac3cb0f388fe3c713bff4799126164e9d0c | 515 | py | Python | modules/nsfw.py | amuritna/phenny | c01f409f41db125fe3f50093ed1ec3454f95a529 | [
"EFL-2.0"
] | 7 | 2018-10-29T18:01:47.000Z | 2022-01-21T04:13:46.000Z | modules/nsfw.py | amuritna/phenny | c01f409f41db125fe3f50093ed1ec3454f95a529 | [
"EFL-2.0"
] | 225 | 2018-03-08T10:41:50.000Z | 2021-11-01T19:51:17.000Z | modules/nsfw.py | amuritna/phenny | c01f409f41db125fe3f50093ed1ec3454f95a529 | [
"EFL-2.0"
] | 44 | 2018-03-19T15:30:15.000Z | 2020-07-29T08:47:45.000Z | #!/usr/bin/python3
"""
nsfw.py - some things just aren't safe for work, a phenny module
author: Casey Link <unnamedrambler@gmail.com
"""
def nsfw(phenny, input):
""".nsfw <link> - Mark a link (or some text) as being not safe for work."""
link = input.group(1)
if not link:
phenny.say(".nsfw <link> -... | 28.611111 | 79 | 0.6 |
def nsfw(phenny, input):
link = input.group(1)
if not link:
phenny.say(".nsfw <link> - for when a link isn't safe for work")
return
phenny.say("!!NSFW!! -> %s <- !!NSFW!!" % (link))
nsfw.rule = (['nsfw'], r'(.*)')
if __name__ == '__main__':
print(__doc__.strip())
| true | true |
1c07bd7945ba0577178f8733c021f216823e8877 | 3,221 | py | Python | lpd/utils/file_utils.py | RoySadaka/lpd | 921454d9730d8228f4b0ca5349b0558ebd123c65 | [
"MIT"
] | 4 | 2020-10-02T10:04:19.000Z | 2022-01-19T12:45:02.000Z | lpd/utils/file_utils.py | RoySadaka/lpd | 921454d9730d8228f4b0ca5349b0558ebd123c65 | [
"MIT"
] | 1 | 2020-10-06T17:43:57.000Z | 2020-10-06T17:47:43.000Z | lpd/utils/file_utils.py | RoySadaka/lpd | 921454d9730d8228f4b0ca5349b0558ebd123c65 | [
"MIT"
] | 1 | 2020-10-03T17:21:32.000Z | 2020-10-03T17:21:32.000Z | import os
import pickle
import gzip
from shutil import copytree, copyfile, move
def is_file_exists(full_path):
return os.path.exists(full_path)
def is_folder_exists(folder_path):
return os.path.exists(folder_path)
def create_folder(full_path):
os.makedirs(full_path)
def ensure_folder_created(full_path):... | 31.578431 | 73 | 0.680224 | import os
import pickle
import gzip
from shutil import copytree, copyfile, move
def is_file_exists(full_path):
return os.path.exists(full_path)
def is_folder_exists(folder_path):
return os.path.exists(folder_path)
def create_folder(full_path):
os.makedirs(full_path)
def ensure_folder_created(full_path):... | true | true |
1c07be6534dc877725a01b867a94c1988f6745ca | 437 | py | Python | test/test_function.py | iskandr/serializable | ed309a6f8f2590b525fc0f93c00549223c8c944f | [
"Apache-2.0"
] | null | null | null | test/test_function.py | iskandr/serializable | ed309a6f8f2590b525fc0f93c00549223c8c944f | [
"Apache-2.0"
] | 1 | 2016-08-08T17:31:46.000Z | 2016-08-08T18:03:28.000Z | test/test_function.py | iskandr/serializable | ed309a6f8f2590b525fc0f93c00549223c8c944f | [
"Apache-2.0"
] | 1 | 2020-06-19T04:55:56.000Z | 2020-06-19T04:55:56.000Z | from serializable import (
to_serializable_repr,
from_serializable_repr,
)
from nose.tools import eq_
def global_fn():
pass
def test_serialize_custom_function():
fn_reconstructed = from_serializable_repr(to_serializable_repr(global_fn))
eq_(global_fn, fn_reconstructed)
def test_serialize_builtin... | 24.277778 | 78 | 0.79405 | from serializable import (
to_serializable_repr,
from_serializable_repr,
)
from nose.tools import eq_
def global_fn():
pass
def test_serialize_custom_function():
fn_reconstructed = from_serializable_repr(to_serializable_repr(global_fn))
eq_(global_fn, fn_reconstructed)
def test_serialize_builtin... | true | true |
1c07bed31d34441d85e31f1b91c26bafe769bcc2 | 8,025 | py | Python | egret/thirdparty/pglib_files.py | kdheepak/Egret | f982247637137e098191453e682376adc1b4c2ac | [
"BSD-3-Clause"
] | 1 | 2021-08-25T12:53:38.000Z | 2021-08-25T12:53:38.000Z | egret/thirdparty/pglib_files.py | kdheepak/Egret | f982247637137e098191453e682376adc1b4c2ac | [
"BSD-3-Clause"
] | 1 | 2019-05-23T02:56:29.000Z | 2019-05-23T02:56:29.000Z | egret/thirdparty/pglib_files.py | kdheepak/Egret | f982247637137e098191453e682376adc1b4c2ac | [
"BSD-3-Clause"
] | 2 | 2019-11-18T20:18:51.000Z | 2020-05-08T15:56:17.000Z | # ___________________________________________________________________________
#
# EGRET: Electrical Grid Research and Engineering Tools
# Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain r... | 51.774194 | 78 | 0.784922 |
pglib_files_to_extract = [
'pglib-opf-master/pglib_opf_case2746wop_k.m',
'pglib-opf-master/MODEL.tex',
'pglib-opf-master/pglib_opf_case2746wp_k.m',
'pglib-opf-master/pglib_opf_case13659_pegase.m',
'pglib-opf-master/pglib_opf_case2000_tamu.m',
'pglib-opf-master/pglib_opf_case6470_rte.m',
'pglib-op... | true | true |
1c07bfa6e3a91882477a3925b04caaee6211dc0f | 3,216 | py | Python | pyiomica/utilityFunctions.py | benstear/pyiomica | bc26032b610fc911cc03b54115d6abdf53a56fce | [
"MIT"
] | null | null | null | pyiomica/utilityFunctions.py | benstear/pyiomica | bc26032b610fc911cc03b54115d6abdf53a56fce | [
"MIT"
] | null | null | null | pyiomica/utilityFunctions.py | benstear/pyiomica | bc26032b610fc911cc03b54115d6abdf53a56fce | [
"MIT"
] | null | null | null | '''Utility functions'''
import multiprocessing
from .globalVariables import *
def readMathIOmicaData(fileName):
'''Read text files exported by MathIOmica and convert to Python data
Parameters:
fileName: str
Path of directories and name of the file containing data
... | 26.578512 | 107 | 0.60852 |
import multiprocessing
from .globalVariables import *
def readMathIOmicaData(fileName):
if os.path.isfile(fileName):
with open(fileName, 'r') as tempFile:
data = tempFile.read()
data = data.replace('\n','').replace('{','(').replace('}',')').replace('->',':').replace... | true | true |
1c07c0c37d686bf8b4ec01d720dff858b5258e77 | 909 | py | Python | test/deepclustering/trainer/test_trainer.py | jizongFox/deep-clustering-toolbox | 0721cbbb278af027409ed4c115ccc743b6daed1b | [
"MIT"
] | 34 | 2019-08-05T03:48:36.000Z | 2022-03-29T03:04:51.000Z | test/deepclustering/trainer/test_trainer.py | jizongFox/deep-clustering-toolbox | 0721cbbb278af027409ed4c115ccc743b6daed1b | [
"MIT"
] | 10 | 2019-05-03T21:02:50.000Z | 2021-12-23T08:01:30.000Z | test/deepclustering/trainer/test_trainer.py | ETS-Research-Repositories/deep-clustering-toolbox | 0721cbbb278af027409ed4c115ccc743b6daed1b | [
"MIT"
] | 5 | 2019-09-29T07:56:03.000Z | 2021-04-22T12:08:50.000Z | from unittest import TestCase
from deepclustering.model import Model
from deepclustering.schedulers.customized_scheduler import RampScheduler
class TestTrainer(TestCase):
def setUp(self) -> None:
super().setUp()
arch_dict = {
"name": "clusternet6cTwoHead",
"input_size": 24... | 28.40625 | 72 | 0.556656 | from unittest import TestCase
from deepclustering.model import Model
from deepclustering.schedulers.customized_scheduler import RampScheduler
class TestTrainer(TestCase):
def setUp(self) -> None:
super().setUp()
arch_dict = {
"name": "clusternet6cTwoHead",
"input_size": 24... | true | true |
1c07c1f8edf604a6387ede354b91f9bfb497896e | 2,192 | py | Python | utils/gpu_queue.py | MrZilinXiao/Exploring-DeepSORT | b16715f725f96a44b86bd302650864b72d3939f0 | [
"MIT"
] | null | null | null | utils/gpu_queue.py | MrZilinXiao/Exploring-DeepSORT | b16715f725f96a44b86bd302650864b72d3939f0 | [
"MIT"
] | null | null | null | utils/gpu_queue.py | MrZilinXiao/Exploring-DeepSORT | b16715f725f96a44b86bd302650864b72d3939f0 | [
"MIT"
] | null | null | null | from utils.parallel import MyPool
from multiprocessing import Manager
from utils.general import GPUManager, Log
import time
import importlib
class GPUQueue:
"""
Self-defined GPUQueue, not usable yet
"""
def __init__(self, gpu_list, indi_size=40):
"""
:param gpu_list: List[int]
... | 37.793103 | 116 | 0.58896 | from utils.parallel import MyPool
from multiprocessing import Manager
from utils.general import GPUManager, Log
import time
import importlib
class GPUQueue:
def __init__(self, gpu_list, indi_size=40):
self.size = len(gpu_list)
self.gpu_list = gpu_list
self.manager = Manager()
self.... | true | true |
1c07c2684eec8d0c4a445cc88c543bfe1da9c864 | 9,288 | py | Python | ppocr/modeling/backbones/table_resnet_vd.py | maxberezov/PaddleOCR | 5ecd1447ad80b1e22a0126ce8bc845ffcd5ae773 | [
"Apache-2.0"
] | 20,401 | 2020-05-08T10:56:13.000Z | 2022-03-31T23:34:38.000Z | ppocr/modeling/backbones/table_resnet_vd.py | justld/PaddleOCR | 09604c38e42591c240771edbbff43a6dd7ebf592 | [
"Apache-2.0"
] | 4,988 | 2020-05-10T08:19:41.000Z | 2022-03-31T17:57:11.000Z | ppocr/modeling/backbones/table_resnet_vd.py | justld/PaddleOCR | 09604c38e42591c240771edbbff43a6dd7ebf592 | [
"Apache-2.0"
] | 4,479 | 2020-05-08T11:12:13.000Z | 2022-03-31T11:55:28.000Z | # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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... | 33.053381 | 77 | 0.500431 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import paddle
from paddle import ParamAttr
import paddle.nn as nn
import paddle.nn.functional as F
__all__ = ["ResNet"]
class ConvBNLayer(nn.Layer):
def __init__(
self,
in_channe... | true | true |
1c07c2c91b3e606cd494950a136a61cac1a8d847 | 359 | py | Python | topCoder/srms/400s/srm439/div2/squared_digits.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-09-30T19:53:08.000Z | 2020-09-30T19:53:08.000Z | topCoder/srms/400s/srm439/div2/squared_digits.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | null | null | null | topCoder/srms/400s/srm439/div2/squared_digits.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-10-15T09:10:57.000Z | 2020-10-15T09:10:57.000Z | class SquareOfDigits:
def getMax(self, data):
lx, ly = len(data), len(data[0])
for s in xrange(min(lx, ly), 1, -1):
for i in xrange(lx-s+1):
for j in xrange(ly-s+1):
if data[i][j] == data[i+s-1][j] == data[i][j+s-1] == data[i+s-1][j+s-1]:
... | 35.9 | 92 | 0.437326 | class SquareOfDigits:
def getMax(self, data):
lx, ly = len(data), len(data[0])
for s in xrange(min(lx, ly), 1, -1):
for i in xrange(lx-s+1):
for j in xrange(ly-s+1):
if data[i][j] == data[i+s-1][j] == data[i][j+s-1] == data[i+s-1][j+s-1]:
... | true | true |
1c07c42e6c34f39c37ca71926289a881eaff4743 | 352 | py | Python | generators/exercises/hamming.py | jonboland/x86-64-assembly | b0d586078b2f9e32ac6cd1de1d833282b2c336c0 | [
"MIT"
] | 21 | 2019-05-12T20:06:11.000Z | 2022-02-06T23:16:13.000Z | generators/exercises/hamming.py | jonboland/x86-64-assembly | b0d586078b2f9e32ac6cd1de1d833282b2c336c0 | [
"MIT"
] | 49 | 2019-04-23T19:17:26.000Z | 2022-03-12T14:30:44.000Z | generators/exercises/hamming.py | jonboland/x86-64-assembly | b0d586078b2f9e32ac6cd1de1d833282b2c336c0 | [
"MIT"
] | 21 | 2019-05-19T21:29:07.000Z | 2022-01-18T08:58:52.000Z | FUNC_PROTO = """\
#include "vendor/unity.h"
extern int distance(const char *strand1, const char *strand2);
"""
def gen_func_body(prop, inp, expected):
strand1 = inp["strand1"]
strand2 = inp["strand2"]
if type(expected) is not int:
expected = -1
return f'TEST_ASSERT_EQUAL_INT({expected}, {prop}... | 27.076923 | 84 | 0.650568 | FUNC_PROTO = """\
#include "vendor/unity.h"
extern int distance(const char *strand1, const char *strand2);
"""
def gen_func_body(prop, inp, expected):
strand1 = inp["strand1"]
strand2 = inp["strand2"]
if type(expected) is not int:
expected = -1
return f'TEST_ASSERT_EQUAL_INT({expected}, {prop}... | true | true |
1c07c4380cdac1e4e91a7b9825117d77d2d52d3e | 130,924 | py | Python | rmgpy/data/thermo.py | rwest/RMG-Py | 54e645b17a8e9a1652c9e60b9251444bc6c25e5f | [
"MIT"
] | 3 | 2015-07-20T17:53:48.000Z | 2019-10-28T17:44:52.000Z | rmgpy/data/thermo.py | rwest/RMG-Py | 54e645b17a8e9a1652c9e60b9251444bc6c25e5f | [
"MIT"
] | null | null | null | rmgpy/data/thermo.py | rwest/RMG-Py | 54e645b17a8e9a1652c9e60b9251444bc6c25e5f | [
"MIT"
] | 4 | 2017-05-19T20:23:16.000Z | 2019-10-23T14:34:41.000Z | #!/usr/bin/env python3
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | 46.311992 | 218 | 0.596835 |
import itertools
import logging
import math
import os.path
import re
import time
from copy import deepcopy
import numpy as np
import rmgpy.constants as constants
import rmgpy.molecule
import rmgpy.quantity
from rmgpy.data.base import Database, Entry, make_logic_node, DatabaseError
from rmgpy.ml.estimator import MLE... | true | true |
1c07c48f4d0cbb1299360a4a4b8d9b3905560940 | 673 | py | Python | manage.py | marcosvporto/INF1407-trabalho2 | 2090be7ac9469c2b541222b4c0d140e905e06cf1 | [
"MIT"
] | null | null | null | manage.py | marcosvporto/INF1407-trabalho2 | 2090be7ac9469c2b541222b4c0d140e905e06cf1 | [
"MIT"
] | null | null | null | manage.py | marcosvporto/INF1407-trabalho2 | 2090be7ac9469c2b541222b4c0d140e905e06cf1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ClubeDeBeneficios.settings')
try:
from django.core.management import execute_from_command_line
e... | 29.26087 | 81 | 0.683507 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ClubeDeBeneficios.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed an... | true | true |
1c07c5cf8a0783e6a9185ba867fb10f07f108891 | 722 | py | Python | setup.py | tistaharahap/oauth1-provider | c7059bce68734744d0aa3b83ecb218865a5c1341 | [
"MIT"
] | 1 | 2017-06-26T07:36:03.000Z | 2017-06-26T07:36:03.000Z | setup.py | tistaharahap/oauth1-provider | c7059bce68734744d0aa3b83ecb218865a5c1341 | [
"MIT"
] | null | null | null | setup.py | tistaharahap/oauth1-provider | c7059bce68734744d0aa3b83ecb218865a5c1341 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='oauth1-provider',
version='0.4.10',
description='OAuth 1.0a Provider for Python',
long_description='Initiallly focused in leveraging performance by using Redis as the primary OAuth Provider backend, user authentications can be handled differently using any oth... | 40.111111 | 232 | 0.67036 | from setuptools import setup
setup(name='oauth1-provider',
version='0.4.10',
description='OAuth 1.0a Provider for Python',
long_description='Initiallly focused in leveraging performance by using Redis as the primary OAuth Provider backend, user authentications can be handled differently using any oth... | true | true |
1c07c6108123c9c42a8ee0cb8ab812e975673c0b | 1,508 | py | Python | saleor/order/migrations/0150_update_authorize_and_charge_status.py | DevPoke/saleor | ced3a2249a18031f9f593e71d1d18aa787ec1060 | [
"CC-BY-4.0"
] | null | null | null | saleor/order/migrations/0150_update_authorize_and_charge_status.py | DevPoke/saleor | ced3a2249a18031f9f593e71d1d18aa787ec1060 | [
"CC-BY-4.0"
] | null | null | null | saleor/order/migrations/0150_update_authorize_and_charge_status.py | DevPoke/saleor | ced3a2249a18031f9f593e71d1d18aa787ec1060 | [
"CC-BY-4.0"
] | null | null | null | # Generated by Django 3.2.13 on 2022-05-19 11:21
from django.db import migrations, models
def update_authorize_status(apps, _schema_editor):
Order = apps.get_model("order", "Order")
order_query = Order.objects.annotate(
sum_authorized=models.F("total_authorized_amount")
+ models.F("total_char... | 30.77551 | 85 | 0.702255 |
from django.db import migrations, models
def update_authorize_status(apps, _schema_editor):
Order = apps.get_model("order", "Order")
order_query = Order.objects.annotate(
sum_authorized=models.F("total_authorized_amount")
+ models.F("total_charged_amount")
)
order_query.filter(
... | true | true |
1c07c7a235f78b52254810e458272edada040b0b | 20,967 | py | Python | MRC_Iver.py | SanjibSarkarU/iver-rf-ac-test | 5b42711c1efe4ec99e8349c37431097aa86e279d | [
"Apache-2.0"
] | null | null | null | MRC_Iver.py | SanjibSarkarU/iver-rf-ac-test | 5b42711c1efe4ec99e8349c37431097aa86e279d | [
"Apache-2.0"
] | null | null | null | MRC_Iver.py | SanjibSarkarU/iver-rf-ac-test | 5b42711c1efe4ec99e8349c37431097aa86e279d | [
"Apache-2.0"
] | null | null | null | from time import monotonic
import time
# import geopy.distance
import serial
import pandas as pd
import numpy as np
# import checkSum
import re
import warnings
import tkinter as tk
from geographiclib.geodesic import Geodesic
import numpy.polynomial.polynomial as poly
import pymap3d as pm
from scipy import ... | 41.273622 | 128 | 0.533696 | from time import monotonic
import time
import serial
import pandas as pd
import numpy as np
import re
import warnings
import tkinter as tk
from geographiclib.geodesic import Geodesic
import numpy.polynomial.polynomial as poly
import pymap3d as pm
from scipy import stats
root = tk.Tk()
root.withdraw()
... | true | true |
1c07c7a425fc7233a0850ff088b00a3f0c9e4994 | 1,348 | py | Python | synapse/storage/data_stores/main/rejections.py | ewaf1/synapse | 77661ce81a799a375317dff9e4c8696da528984c | [
"Apache-2.0"
] | 2 | 2020-04-30T18:38:02.000Z | 2020-07-08T21:38:28.000Z | synapse/storage/data_stores/main/rejections.py | ewaf1/synapse | 77661ce81a799a375317dff9e4c8696da528984c | [
"Apache-2.0"
] | null | null | null | synapse/storage/data_stores/main/rejections.py | ewaf1/synapse | 77661ce81a799a375317dff9e4c8696da528984c | [
"Apache-2.0"
] | 2 | 2020-03-03T18:34:52.000Z | 2022-03-31T11:06:18.000Z | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 31.348837 | 74 | 0.654303 |
import logging
from synapse.storage._base import SQLBaseStore
logger = logging.getLogger(__name__)
class RejectionsStore(SQLBaseStore):
def _store_rejections_txn(self, txn, event_id, reason):
self.db.simple_insert_txn(
txn,
table="rejections",
values={
... | true | true |
1c07c81d65ba9357d6ff5ddaa6dbcad6755a604d | 6,793 | py | Python | src/python/pants/option/options_fingerprinter.py | GoingTharn/pants | d3f2005dcae0745f3e3bf525fc46e7d28f04f073 | [
"Apache-2.0"
] | null | null | null | src/python/pants/option/options_fingerprinter.py | GoingTharn/pants | d3f2005dcae0745f3e3bf525fc46e7d28f04f073 | [
"Apache-2.0"
] | null | null | null | src/python/pants/option/options_fingerprinter.py | GoingTharn/pants | d3f2005dcae0745f3e3bf525fc46e7d28f04f073 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import functools
import json
import os
from builtins import object, str
from hashlib impo... | 37.949721 | 100 | 0.687914 |
from __future__ import absolute_import, division, print_function, unicode_literals
import functools
import json
import os
from builtins import object, str
from hashlib import sha1
import six
from pants.base.build_environment import get_buildroot
from pants.base.hash_utils import stable_json_hash
from pants.option.c... | true | true |
1c07c846a8a6055d7a35a6a703bcc89d45bbff49 | 625 | py | Python | mot/utils/logger.py | CnybTseng/JDE | 599bd6de74fc3794694bf1e3baca741d2b517e0e | [
"MIT"
] | 23 | 2020-07-03T10:14:20.000Z | 2021-03-29T07:34:31.000Z | mot/utils/logger.py | CnybTseng/JDE | 599bd6de74fc3794694bf1e3baca741d2b517e0e | [
"MIT"
] | 4 | 2020-09-23T14:30:46.000Z | 2021-04-01T02:17:13.000Z | mot/utils/logger.py | CnybTseng/JDE | 599bd6de74fc3794694bf1e3baca741d2b517e0e | [
"MIT"
] | 8 | 2020-07-13T08:33:19.000Z | 2021-03-31T09:16:30.000Z | import logging
def get_logger(name='root', path=None):
'''Get logger.
Param
-----
name: Logger name.
path: Log filepath.
Return
------
The created logger.
'''
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
if path is None:
handler = log... | 24.038462 | 61 | 0.5968 | import logging
def get_logger(name='root', path=None):
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
if path is None:
handler = logging.StreamHandler()
else:
handler = logging.FileHandler(path, encoding='utf-8')
formatter = logging.Formatter(
fmt='%(asctime... | true | true |
1c07c8d3dadd28299a4c6cb44356e2720aa98454 | 2,122 | py | Python | utils/env_enum.py | Shikairen/day1 | e148fb0cff4b458f5452bf7c72d17eafce4c4c38 | [
"MIT"
] | 1 | 2019-12-12T13:03:43.000Z | 2019-12-12T13:03:43.000Z | utils/env_enum.py | Shikairen/day1 | e148fb0cff4b458f5452bf7c72d17eafce4c4c38 | [
"MIT"
] | null | null | null | utils/env_enum.py | Shikairen/day1 | e148fb0cff4b458f5452bf7c72d17eafce4c4c38 | [
"MIT"
] | 3 | 2019-10-23T09:15:05.000Z | 2021-09-24T07:57:59.000Z | import os
from enum import Enum
class EnvEnum(Enum):
# 需手动更改的参数(选择默认也可以)
DIST_CONFIGURATION_NAME = 'Release' # 项目工程中发布的 configuration 的名称
ARCHIVE_DIR_NAME = 'Products' # 归档的目录名称
SCRIPT_DIR_NAME = 'scripts' # 存放脚本项目的目录名称
# 自定义环境变量
CONF_FILE_NAME = os.getenv('CONF_FILE_NAME') # 配置文件的名称
... | 40.807692 | 105 | 0.709708 | import os
from enum import Enum
class EnvEnum(Enum):
DIST_CONFIGURATION_NAME = 'Release' ARCHIVE_DIR_NAME = 'Products' SCRIPT_DIR_NAME = 'scripts'
CONF_FILE_NAME = os.getenv('CONF_FILE_NAME') CONFIGURATION = os.getenv('CONFIGURATIONS') APP_VERSION = os.getenv('APP_VERSION') ... | true | true |
1c07c91bebbdd990cf1fb02ff9ac416921535caf | 16,367 | py | Python | dependency_analyzer_const.py | ucd-plse/PyDFix | 1933d7af481edc7884cdae89d12054d05524a88c | [
"BSD-3-Clause"
] | 8 | 2021-10-06T10:17:00.000Z | 2022-01-24T05:16:29.000Z | dependency_analyzer_const.py | ucd-plse/PyDFix | 1933d7af481edc7884cdae89d12054d05524a88c | [
"BSD-3-Clause"
] | null | null | null | dependency_analyzer_const.py | ucd-plse/PyDFix | 1933d7af481edc7884cdae89d12054d05524a88c | [
"BSD-3-Clause"
] | 3 | 2021-07-15T03:11:39.000Z | 2022-03-28T03:02:32.000Z | from error_patterns import inexact_pattern_list, error_pattern_list
class DependencyAnalyzerConstants:
INEXACT_PATTERN_LIST = inexact_pattern_list
ERROR_PATTERN_LIST = error_pattern_list
# Header labels for Metrics.csv
CSV_METRICS_HEADERS = ['Repository Name', 'Pass or Fail', 'Commit SHA', 'Image Ta... | 44.718579 | 225 | 0.652349 | from error_patterns import inexact_pattern_list, error_pattern_list
class DependencyAnalyzerConstants:
INEXACT_PATTERN_LIST = inexact_pattern_list
ERROR_PATTERN_LIST = error_pattern_list
CSV_METRICS_HEADERS = ['Repository Name', 'Pass or Fail', 'Commit SHA', 'Image Tag',
'... | false | true |
1c07ca945cf673330862a40c0b057dd02eca6faf | 10,541 | py | Python | configs/ruby/MOESI_hammer.py | cmlasu/smm_gem5 | 2865229999904d531f5510ca50552b396efeaea0 | [
"BSD-3-Clause"
] | 10 | 2019-10-21T08:33:13.000Z | 2021-06-17T00:21:13.000Z | configs/ruby/MOESI_hammer.py | jcai19/smm_gem5 | 15e10bd32ef4a4d18e5d846b015d11317d319bcc | [
"BSD-3-Clause"
] | null | null | null | configs/ruby/MOESI_hammer.py | jcai19/smm_gem5 | 15e10bd32ef4a4d18e5d846b015d11317d319bcc | [
"BSD-3-Clause"
] | 6 | 2019-06-20T14:57:50.000Z | 2021-06-05T20:08:26.000Z | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2009 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source co... | 42.333333 | 82 | 0.603833 |
import math
import m5
from m5.objects import *
from m5.defines import buildEnv
from Ruby import create_topology
class L1Cache(RubyCache):
latency = 2
class L2Cache(RubyCache):
latency = 10
class ProbeFilter(RubyCache):
latency = 1
def define_options(parser):
parser.add_option("--allow-atomic-migrat... | true | true |
1c07cac48efbc3469f472f0a0e06e2c72ae69df8 | 392 | py | Python | About.py | animeshsrivastava24/3D-SCANNER-IITB | 0d5d12916ce628ced0d4a8e87d77d2cfc12e862f | [
"MIT"
] | 17 | 2017-06-08T16:16:15.000Z | 2021-04-27T05:40:52.000Z | About.py | animeshsrivastava24/3D-SCANNER-IITB | 0d5d12916ce628ced0d4a8e87d77d2cfc12e862f | [
"MIT"
] | null | null | null | About.py | animeshsrivastava24/3D-SCANNER-IITB | 0d5d12916ce628ced0d4a8e87d77d2cfc12e862f | [
"MIT"
] | 15 | 2017-06-13T04:38:41.000Z | 2021-09-29T02:53:20.000Z | '''This code is a part of the 3D Scanner project'''
'''Developed by team SAAS'''
'''Ekalavya 2017'''
'''IIT Bombay'''
import Tkinter as tk
import Main
#this is a function that opens a pop-up window
def About():
PopupWindow=tk.Tk()
PopupWindow.title("About")
label1 =tk.Label(PopupWindow, text=Main.AboutText) #it w... | 24.5 | 113 | 0.72449 |
import Tkinter as tk
import Main
def About():
PopupWindow=tk.Tk()
PopupWindow.title("About")
label1 =tk.Label(PopupWindow, text=Main.AboutText) label1.pack()
| true | true |
1c07cb57aa4cd35cf6ef56ee6f5ccf86a662a4ce | 887 | py | Python | list_comprehension2.py | iansantana00/Python-Course | 43852aa64c93099342ab4765b0fe8729a959449e | [
"MIT"
] | 2 | 2022-01-13T15:55:58.000Z | 2022-02-11T23:18:34.000Z | list_comprehension2.py | iansantana00/Python-Course | 43852aa64c93099342ab4765b0fe8729a959449e | [
"MIT"
] | null | null | null | list_comprehension2.py | iansantana00/Python-Course | 43852aa64c93099342ab4765b0fe8729a959449e | [
"MIT"
] | null | null | null | """
List Comprehension
Nós podemos adicionar estruturas condicionais lógicas às nossas List Comprehension
"""
# Exemplos
# 1
numeros = [1, 2, 3, 4, 5, 6]
pares = [numero for numero in numeros if numero % 2 == 0]
impares = [numero for numero in numeros if numero % 2 == 1]
print(pares)
print(impares... | 25.342857 | 90 | 0.676437 |
numeros = [1, 2, 3, 4, 5, 6]
pares = [numero for numero in numeros if numero % 2 == 0]
impares = [numero for numero in numeros if numero % 2 == 1]
print(pares)
print(impares)
pares = [numero for numero in numeros if not numero % 2]
impares = [numero for numero in numeros if numero % 2]
print(pa... | true | true |
1c07cc42e7ff20e7ee59419b60e0b6994cb6d93a | 1,223 | py | Python | Part-6 Nginx React and Django Gunicorn/Starting Repository/django/blog/models.py | NyntoFive/docker-mastery-with-django | a451957e440a8ce68563495bce64d7736811a2e0 | [
"MIT"
] | 79 | 2021-04-17T19:59:07.000Z | 2022-03-31T14:39:52.000Z | Part-6 Nginx React and Django Gunicorn/Starting Repository/django/blog/models.py | dentonya/docker-mastery-with-django | a451957e440a8ce68563495bce64d7736811a2e0 | [
"MIT"
] | 6 | 2022-02-15T02:42:31.000Z | 2022-02-28T01:29:11.000Z | Part-6 Nginx React and Django Gunicorn/Starting Repository/django/blog/models.py | dentonya/docker-mastery-with-django | a451957e440a8ce68563495bce64d7736811a2e0 | [
"MIT"
] | 86 | 2021-04-21T22:13:05.000Z | 2022-03-31T08:33:19.000Z | from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
class Category(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
class Post(models.Model):
class PostObjects(models.Manager):
def get_quer... | 29.119048 | 72 | 0.676206 | from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
class Category(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
class Post(models.Model):
class PostObjects(models.Manager):
def get_quer... | true | true |
1c07ccafec64f1acb8fb8b6e3cc13e42d2b19fca | 18,120 | py | Python | batcher.py | ralgara/pointer-generator | 4c5ebec95af14847218326175a1a31b0232a74aa | [
"Apache-2.0"
] | null | null | null | batcher.py | ralgara/pointer-generator | 4c5ebec95af14847218326175a1a31b0232a74aa | [
"Apache-2.0"
] | null | null | null | batcher.py | ralgara/pointer-generator | 4c5ebec95af14847218326175a1a31b0232a74aa | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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... | 48.32 | 356 | 0.713687 |
import queue
from random import shuffle
from threading import Thread
import time
import numpy as np
import tensorflow as tf
import data
class Example(object):
def __init__(self, article, abstract_sentences, vocab, hps):
self.hps = hps
start_decoding = vocab.word2id(data.START_DECODING)
stop_deco... | true | true |
1c07cf5fef5087ed8c62f177cca98cd001959a88 | 745 | py | Python | data/plugins/objects/rotten tomato crate.py | FavyTeam/Elderscape_server | 38bf75396e4e13222be67d5f15eb0b9862dca6bb | [
"MIT"
] | 3 | 2019-05-09T16:59:13.000Z | 2019-05-09T18:29:57.000Z | data/plugins/objects/rotten tomato crate.py | FavyTeam/Elderscape_server | 38bf75396e4e13222be67d5f15eb0b9862dca6bb | [
"MIT"
] | null | null | null | data/plugins/objects/rotten tomato crate.py | FavyTeam/Elderscape_server | 38bf75396e4e13222be67d5f15eb0b9862dca6bb | [
"MIT"
] | 7 | 2019-07-11T23:04:40.000Z | 2021-08-02T14:27:13.000Z | from game.item import ItemAssistant
def first_click_object_3195(player):
if player.playerRights == 1 or player.playerRights == 2:
if (ItemAssistant.getFreeInventorySlots(player) == 0):
player.getDH().sendStatement("You need at least 1 free inventory space to do this.")
return
... | 53.214286 | 96 | 0.680537 | from game.item import ItemAssistant
def first_click_object_3195(player):
if player.playerRights == 1 or player.playerRights == 2:
if (ItemAssistant.getFreeInventorySlots(player) == 0):
player.getDH().sendStatement("You need at least 1 free inventory space to do this.")
return
... | true | true |
1c07cf7c8c959d0afd6d10aa91e5a55c4526dbfb | 2,354 | py | Python | src/bpp/migrations/0301_doktorska_habilitacyjna_denorm.py | iplweb/django-bpp | 85f183a99d8d5027ae4772efac1e4a9f21675849 | [
"BSD-3-Clause"
] | 1 | 2017-04-27T19:50:02.000Z | 2017-04-27T19:50:02.000Z | src/bpp/migrations/0301_doktorska_habilitacyjna_denorm.py | mpasternak/django-bpp | 434338821d5ad1aaee598f6327151aba0af66f5e | [
"BSD-3-Clause"
] | 41 | 2019-11-07T00:07:02.000Z | 2022-02-27T22:09:39.000Z | src/bpp/migrations/0301_doktorska_habilitacyjna_denorm.py | iplweb/bpp | f027415cc3faf1ca79082bf7bacd4be35b1a6fdf | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.0.14 on 2021-10-03 18:31
from django.db import migrations, models
import django.contrib.postgres.fields
class Migration(migrations.Migration):
dependencies = [
("bpp", "0300_patent_denorm"),
]
operations = [
migrations.AlterField(
model_name="praca_d... | 32.694444 | 82 | 0.567545 |
from django.db import migrations, models
import django.contrib.postgres.fields
class Migration(migrations.Migration):
dependencies = [
("bpp", "0300_patent_denorm"),
]
operations = [
migrations.AlterField(
model_name="praca_doktorska",
name="opis_bibliograficzny... | true | true |
1c07cf9c09adb5cb760f226355714345e5d2ce2e | 1,225 | py | Python | dj_celery_progress_sample/urls.py | ebysofyan/django-celery-progress-sample | 311289c01a6d603daafd804d30699b0019e47409 | [
"MIT"
] | 10 | 2020-10-25T04:27:22.000Z | 2022-01-02T21:38:24.000Z | dj_celery_progress_sample/urls.py | jmejia-bnc/django-celery-progress-sample | 311289c01a6d603daafd804d30699b0019e47409 | [
"MIT"
] | null | null | null | dj_celery_progress_sample/urls.py | jmejia-bnc/django-celery-progress-sample | 311289c01a6d603daafd804d30699b0019e47409 | [
"MIT"
] | 5 | 2021-04-25T08:10:10.000Z | 2022-03-21T17:47:20.000Z | """dj_celery_progress_sample URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/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="... | 38.28125 | 77 | 0.713469 | from os import name
from django.contrib import admin
from django.urls import path
from .views import (IndexTemplateView, download_file_view, export_user_view,
get_progress_view, import_user_view)
urlpatterns = [
path("admin/", admin.site.urls),
path("", IndexTemplateView.as_view(), name="... | true | true |
1c07d00b6acfd0d83dc542fd5d9fa3ef15bc2227 | 5,943 | py | Python | gridftp/net_manager/test/test_module.py | jtfrey/globus-toolkit | ee55e99c6d6a6dd2dbd4246c0537e0b083069a5d | [
"Apache-2.0"
] | 44 | 2015-02-04T22:01:05.000Z | 2021-01-27T21:18:47.000Z | gridftp/net_manager/test/test_module.py | jtfrey/globus-toolkit | ee55e99c6d6a6dd2dbd4246c0537e0b083069a5d | [
"Apache-2.0"
] | 69 | 2015-04-07T16:07:26.000Z | 2020-06-17T20:00:34.000Z | gridftp/net_manager/test/test_module.py | ellert/globus-toolkit | 14761278bf048b0d9bd3d46ab4c3c987b968f2d3 | [
"Apache-2.0"
] | 51 | 2015-04-07T14:29:47.000Z | 2021-09-23T08:44:18.000Z | #! /usr/bin/python
def pre_listen(task_id, transport, attrs):
res = None
for (scope, name, value) in attrs:
print "# (%s, %s, %s)" % (scope, name, value)
if scope == 'python':
if name == 'test_func' and value != "pre_listen":
raise "pre_listen called when ", value, "... | 38.096154 | 75 | 0.558472 |
def pre_listen(task_id, transport, attrs):
res = None
for (scope, name, value) in attrs:
print "# (%s, %s, %s)" % (scope, name, value)
if scope == 'python':
if name == 'test_func' and value != "pre_listen":
raise "pre_listen called when ", value, " expected"
... | false | true |
1c07d12c4edf47d6969a3c78cb8eda9930c6f693 | 19,344 | py | Python | SUAVE/SUAVE-2.5.0/trunk/SUAVE/Components/Energy/Networks/Battery_Propeller.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | SUAVE/SUAVE-2.5.0/trunk/SUAVE/Components/Energy/Networks/Battery_Propeller.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | SUAVE/SUAVE-2.5.0/trunk/SUAVE/Components/Energy/Networks/Battery_Propeller.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | ## @ingroup Components-Energy-Networks
# Battery_Propeller.py
#
# Created: Jul 2015, E. Botero
# Modified: Feb 2016, T. MacDonald
# Mar 2020, M. Clarke
# Apr 2021, M. Clarke
# Jul 2021, E. Botero
# Jul 2021, R. Erhard
# Aug 2021, M. Clarke
# ------------------------... | 43.275168 | 126 | 0.533189 |
import SUAVE
import numpy as np
from .Network import Network
from SUAVE.Analyses.Mission.Segments.Conditions import Residuals
from SUAVE.Components.Physical_Component import Container
from SUAVE.Methods.Power.Battery.pack_battery_conditions import pack_battery_conditions
from SUAVE.Methods.Power.Battery.append_initi... | true | true |
1c07d15d68c27db32f4ac5a96b8a95c210a81178 | 366 | py | Python | test/myproject/regist/auth.py | CloudKloud/CloudKloud | 2f00ff43ca239ef7b06a511037b910c537b40893 | [
"MIT"
] | 1 | 2021-01-23T11:21:30.000Z | 2021-01-23T11:21:30.000Z | test/myproject/regist/auth.py | CloudKloud/CloudKloud | 2f00ff43ca239ef7b06a511037b910c537b40893 | [
"MIT"
] | null | null | null | test/myproject/regist/auth.py | CloudKloud/CloudKloud | 2f00ff43ca239ef7b06a511037b910c537b40893 | [
"MIT"
] | 2 | 2020-12-18T17:56:58.000Z | 2020-12-23T05:20:34.000Z | import boto3
def auth(accesskeyid, secretaccesskey):
try:
logs = boto3.client('logs', aws_access_key_id=accesskeyid, aws_secret_access_key=secretaccesskey, region_name = "ap-northeast-2")
result = logs.describe_log_groups()
return True
except Exception as ex:
... | 21.529412 | 137 | 0.636612 | import boto3
def auth(accesskeyid, secretaccesskey):
try:
logs = boto3.client('logs', aws_access_key_id=accesskeyid, aws_secret_access_key=secretaccesskey, region_name = "ap-northeast-2")
result = logs.describe_log_groups()
return True
except Exception as ex:
... | true | true |
1c07d1673b334e55e1f7d3806da7073d0fbd0849 | 3,028 | py | Python | software/metax/MatrixManager.py | sudhaveturi/repo | 7510d31fe27a0e759e12850f281619ce415dd279 | [
"MIT"
] | null | null | null | software/metax/MatrixManager.py | sudhaveturi/repo | 7510d31fe27a0e759e12850f281619ce415dd279 | [
"MIT"
] | null | null | null | software/metax/MatrixManager.py | sudhaveturi/repo | 7510d31fe27a0e759e12850f281619ce415dd279 | [
"MIT"
] | null | null | null | import pandas
import numpy
import Exceptions
def load_matrix_manager(path):
d = pandas.read_table(path, sep="\s+")
m = MatrixManager(d)
return m
class MatrixManager(object):
def __init__(self, d):
_validate(d)
self.data = _build_data(d)
def get(self, gene, snps=None, strict=True)... | 27.279279 | 118 | 0.575297 | import pandas
import numpy
import Exceptions
def load_matrix_manager(path):
d = pandas.read_table(path, sep="\s+")
m = MatrixManager(d)
return m
class MatrixManager(object):
def __init__(self, d):
_validate(d)
self.data = _build_data(d)
def get(self, gene, snps=None, strict=True)... | true | true |
1c07d38ee70930a6a371331508d630939d57fff6 | 14,706 | py | Python | objectModel/Python/tests/storage/test_adls.py | dciborow/CDM | 0bcd0a89854c22ff4d9e451fe5c8d296ec8952ad | [
"CC-BY-4.0",
"MIT"
] | null | null | null | objectModel/Python/tests/storage/test_adls.py | dciborow/CDM | 0bcd0a89854c22ff4d9e451fe5c8d296ec8952ad | [
"CC-BY-4.0",
"MIT"
] | null | null | null | objectModel/Python/tests/storage/test_adls.py | dciborow/CDM | 0bcd0a89854c22ff4d9e451fe5c8d296ec8952ad | [
"CC-BY-4.0",
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
import datetime
from datetime import timezone
import time
import json
import unittest
import os
from tests.common import async_test, TestHelper
from tests.adls_te... | 55.704545 | 220 | 0.721746 |
import datetime
from datetime import timezone
import time
import json
import unittest
import os
from tests.common import async_test, TestHelper
from tests.adls_test_helper import AdlsTestHelper
from cdm.storage.adls import ADLSAdapter
from cdm.utilities.network.token_provider import TokenProvider
from cdm.objectmode... | false | true |
1c07d3d48cc42fb656d45e1902c30e25679d93f8 | 119 | py | Python | HackerRank/Python/Built-Ins/ginortS.py | TISparta/competitive-programming-solutions | 31987d4e67bb874bf15653565c6418b5605a20a8 | [
"MIT"
] | 1 | 2018-01-30T13:21:30.000Z | 2018-01-30T13:21:30.000Z | HackerRank/Python/Built-Ins/ginortS.py | TISparta/competitive-programming-solutions | 31987d4e67bb874bf15653565c6418b5605a20a8 | [
"MIT"
] | null | null | null | HackerRank/Python/Built-Ins/ginortS.py | TISparta/competitive-programming-solutions | 31987d4e67bb874bf15653565c6418b5605a20a8 | [
"MIT"
] | 1 | 2018-08-29T13:26:50.000Z | 2018-08-29T13:26:50.000Z | print(*sorted(input(),key = lambda x: (x.isdigit() and int(x)&1==0, x.isdigit(), x.isupper(), x.islower(), x)),sep="")
| 59.5 | 118 | 0.596639 | print(*sorted(input(),key = lambda x: (x.isdigit() and int(x)&1==0, x.isdigit(), x.isupper(), x.islower(), x)),sep="")
| true | true |
1c07d5aacd9dcd7513b0b5eb697af5a7faafaaa6 | 165 | py | Python | rocketgram/middlewares/prometheus.py | rocketbots/rocketgram | e509dcfad85d47a2449caf6dd302ec8581f95bf6 | [
"MIT"
] | 16 | 2019-02-27T20:15:52.000Z | 2019-08-06T10:59:41.000Z | rocketgram/middlewares/prometheus.py | rocketbots/rocketgram | e509dcfad85d47a2449caf6dd302ec8581f95bf6 | [
"MIT"
] | 1 | 2019-04-27T06:51:57.000Z | 2019-05-31T18:09:16.000Z | rocketgram/middlewares/prometheus.py | rocketbots/rocketgram | e509dcfad85d47a2449caf6dd302ec8581f95bf6 | [
"MIT"
] | 3 | 2019-03-19T16:01:22.000Z | 2019-04-05T15:58:12.000Z | # Copyright (C) 2015-2022 by Vd.
# This file is part of Rocketgram, the modern Telegram bot framework.
# Rocketgram is released under the MIT License (see LICENSE).
| 41.25 | 69 | 0.757576 | true | true | |
1c07d6d144f516e498dec706b4c4919ff8bdefe7 | 670 | py | Python | imagersite/imager_images/migrations/0004_auto_20171129_2201.py | chaitanyanarukulla/django-imager | 0c426729605936ecf4deea837295c0b0e22d7861 | [
"MIT"
] | 2 | 2018-05-29T23:39:40.000Z | 2018-06-25T22:31:13.000Z | imagersite/imager_images/migrations/0004_auto_20171129_2201.py | chaitanyanarukulla/django-imager | 0c426729605936ecf4deea837295c0b0e22d7861 | [
"MIT"
] | 15 | 2017-11-22T00:22:01.000Z | 2017-12-14T21:11:13.000Z | imagersite/imager_images/migrations/0004_auto_20171129_2201.py | chaitanyanarukulla/django-imager | 0c426729605936ecf4deea837295c0b0e22d7861 | [
"MIT"
] | 3 | 2018-01-12T08:21:46.000Z | 2018-05-20T05:27:33.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-11-29 22:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('imager_images', '0003_auto_20171129_0142'),
]
operations = [
migrations.Alter... | 25.769231 | 83 | 0.607463 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('imager_images', '0003_auto_20171129_0142'),
]
operations = [
migrations.AlterField(
model_name='album',
name='title',
... | true | true |
1c07d6e7bb3e6201249cc2a4b210be49075f6a6e | 1,297 | py | Python | test/test_history_file_statistic.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | test/test_history_file_statistic.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | test/test_history_file_statistic.py | Atomicology/isilon_sdk_python | 91039da803ae37ed4abf8d2a3f59c333f3ef1866 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... | 26.469388 | 83 | 0.74017 |
from __future__ import absolute_import
import os
import sys
import unittest
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.history_file_statistic import HistoryFileStatistic
class TestHistoryFileStatistic(unittest.TestCase):
def setUp(self):
pass
de... | true | true |
1c07d7101a95da2e675b16882bc9970d2006ded9 | 14,069 | py | Python | Tests/05-1Particle/part_cpu_vs_gpu_32cube.py | copmat/LBcuda | 9ed17910565f237899775733568ceb5966bdad94 | [
"BSD-3-Clause"
] | null | null | null | Tests/05-1Particle/part_cpu_vs_gpu_32cube.py | copmat/LBcuda | 9ed17910565f237899775733568ceb5966bdad94 | [
"BSD-3-Clause"
] | 1 | 2022-02-09T21:46:14.000Z | 2022-02-09T21:46:14.000Z | Tests/05-1Particle/part_cpu_vs_gpu_32cube.py | copmat/LBcuda | 9ed17910565f237899775733568ceb5966bdad94 | [
"BSD-3-Clause"
] | null | null | null | # state file generated using paraview version 5.7.0
# ----------------------------------------------------------------
# setup views used in the visualization
# ----------------------------------------------------------------
# trace generated using paraview version 5.7.0
#
# To ensure correct image size when batch p... | 45.092949 | 395 | 0.731822 |
from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()
materialLibrary1 = GetMaterialLibrary()
renderView1 = CreateView('RenderView')
renderView1.ViewSize = [1474, 389]
renderView1.InteractionMode = '2D'
renderView1.AxesGrid = 'GridAxes3DActor'
renderView1.CenterOfRotation = [16.5, 16.5, 16... | true | true |
1c07d8ae8db6b23264d5ed3dafbae6056e5b9fb3 | 1,071 | py | Python | DQDUE.py | DITAS-Project/data-utility-evaluator | 5333454652d16b619239a9cd4d9b3fec3476710e | [
"Apache-2.0"
] | null | null | null | DQDUE.py | DITAS-Project/data-utility-evaluator | 5333454652d16b619239a9cd4d9b3fec3476710e | [
"Apache-2.0"
] | null | null | null | DQDUE.py | DITAS-Project/data-utility-evaluator | 5333454652d16b619239a9cd4d9b3fec3476710e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 25 18:18:03 2020
@author: cappiello
"""
#from zipfile import ZipFile
import json
import csv
#import requests, zipfile, StringIO
#r = requests.get(zip_file_url, stream=True)
#z = zipfile.ZipFile(StringIO.StringIO(r.content))
#z.extractall()
def mai... | 25.5 | 85 | 0.633987 |
import json
import csv
def main():
data = json.load(open('dataset/getNutritionalData.json'))
sample_data = open('dataset/getNutritionalData.csv', 'w')
csvwriter = csv.writer(sample_data)
count=0
for item in data:
if count == 0:
header=item.keys()
... | true | true |
1c07dafa181186f5f77660b34cc759a98ac68f46 | 93 | py | Python | lepmlutils/pdutils/estmode.py | Lewington-pitsos/mlutils | c92322a8a2fc0b5342d44b0d92051a93c6eede44 | [
"MIT"
] | null | null | null | lepmlutils/pdutils/estmode.py | Lewington-pitsos/mlutils | c92322a8a2fc0b5342d44b0d92051a93c6eede44 | [
"MIT"
] | null | null | null | lepmlutils/pdutils/estmode.py | Lewington-pitsos/mlutils | c92322a8a2fc0b5342d44b0d92051a93c6eede44 | [
"MIT"
] | null | null | null | from enum import Enum
class EstMode(Enum):
classify = "classify"
regress = "regress" | 18.6 | 25 | 0.688172 | from enum import Enum
class EstMode(Enum):
classify = "classify"
regress = "regress" | true | true |
1c07db08b86a3e1d9f063b929bca99aedfcb5238 | 2,709 | py | Python | tools/registerImage.py | iPlantCollaborativeOpenSource/iPlant-Atmosphere | d67b953561e813dd30ffa52c8440af7cc2d990cf | [
"Unlicense"
] | 1 | 2017-10-05T08:03:37.000Z | 2017-10-05T08:03:37.000Z | tools/registerImage.py | iPlantCollaborativeOpenSource/iPlant-Atmosphere | d67b953561e813dd30ffa52c8440af7cc2d990cf | [
"Unlicense"
] | null | null | null | tools/registerImage.py | iPlantCollaborativeOpenSource/iPlant-Atmosphere | d67b953561e813dd30ffa52c8440af7cc2d990cf | [
"Unlicense"
] | null | null | null | #!/usr/bin/python
import httplib
import urllib
from urlparse import urlparse
import string
import datetime
import getpass
import json
print """\nregisterImage version 20110310_001\n"""
username = raw_input("input your username: ")
password = getpass.getpass("input your password: ")
class MissingFieldError(Excepti... | 29.129032 | 101 | 0.668143 |
import httplib
import urllib
from urlparse import urlparse
import string
import datetime
import getpass
import json
print """\nregisterImage version 20110310_001\n"""
username = raw_input("input your username: ")
password = getpass.getpass("input your password: ")
class MissingFieldError(Exception):
def __init_... | false | true |
1c07dbf15125f99fc425ef68f80c9f727f99a908 | 4,278 | py | Python | benchmarks/old_tests/future-recv-fast.py | jacobtomlinson/ucx-py | 7ac246f521d936b8f1fe9026c593d01ac50efbf7 | [
"BSD-3-Clause"
] | 1 | 2020-12-26T09:59:04.000Z | 2020-12-26T09:59:04.000Z | benchmarks/old_tests/future-recv-fast.py | jacobtomlinson/ucx-py | 7ac246f521d936b8f1fe9026c593d01ac50efbf7 | [
"BSD-3-Clause"
] | null | null | null | benchmarks/old_tests/future-recv-fast.py | jacobtomlinson/ucx-py | 7ac246f521d936b8f1fe9026c593d01ac50efbf7 | [
"BSD-3-Clause"
] | 1 | 2021-01-13T03:42:52.000Z | 2021-01-13T03:42:52.000Z | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
#
# Description: 2-process test that tests the functionality of sending
# and receiving Message objects populated using buffer_region
# objects. buffer_region objects encapsulate the actual buffers which
# are transferred.
#
# ... | 26.245399 | 87 | 0.685601 |
import argparse
import asyncio
import concurrent.futures
import time
import ucp
max_msg_log = 23
async def talk_to_client(ep):
global args
global max_msg_log
start_string = "in talk_to_client"
if args.blind_recv:
start_string += " + blind recv"
if args.use_fast:
start_string +... | true | true |
1c07dc63887918b2d699f24d5854be944f2cebe7 | 4,664 | py | Python | model.py | aPToul/Experiments-in-Music | 4c128597f42239bedcb3dde6fa688f3e4609353a | [
"MIT"
] | 6 | 2016-06-08T14:19:37.000Z | 2021-08-15T02:52:15.000Z | model.py | aPToul/Experiments-in-Music | 4c128597f42239bedcb3dde6fa688f3e4609353a | [
"MIT"
] | null | null | null | model.py | aPToul/Experiments-in-Music | 4c128597f42239bedcb3dde6fa688f3e4609353a | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.models.rnn import rnn_cell
from tensorflow.models.rnn import seq2seq
import numpy as np
class Model():
def __init__(self, args, infer=False, loop=0):
self.args = args
if infer:
args.batch_size = 1
args.seq_length = 1
if args.... | 36.4375 | 137 | 0.574828 | import tensorflow as tf
from tensorflow.models.rnn import rnn_cell
from tensorflow.models.rnn import seq2seq
import numpy as np
class Model():
def __init__(self, args, infer=False, loop=0):
self.args = args
if infer:
args.batch_size = 1
args.seq_length = 1
if args.... | false | true |
1c07dccaa2a2c41d6003b07faac6452785f33776 | 113,119 | py | Python | src/twisted/web/test/test_agent.py | tkluck/twisted | 411d08f688bd8cdf61650e0ea1b24e99e14330e0 | [
"MIT",
"Unlicense"
] | null | null | null | src/twisted/web/test/test_agent.py | tkluck/twisted | 411d08f688bd8cdf61650e0ea1b24e99e14330e0 | [
"MIT",
"Unlicense"
] | null | null | null | src/twisted/web/test/test_agent.py | tkluck/twisted | 411d08f688bd8cdf61650e0ea1b24e99e14330e0 | [
"MIT",
"Unlicense"
] | null | null | null | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.client.Agent} and related new client APIs.
"""
import zlib
from io import BytesIO
from zope.interface.verify import verifyObject
from twisted.trial.unittest import TestCase
from twisted.web import client, error, htt... | 35.272529 | 93 | 0.625527 |
import zlib
from io import BytesIO
from zope.interface.verify import verifyObject
from twisted.trial.unittest import TestCase
from twisted.web import client, error, http_headers
from twisted.web._newclient import RequestNotSent, RequestTransmissionFailed
from twisted.web._newclient import ResponseNeverReceived, Re... | true | true |
1c07dd300d4f59861c749ffdd308c0256686a64f | 3,777 | py | Python | result2bvh.py | DK-Jang/human_motion_manifold | dd3b603b892d66685204909c8818f3e1621ab7dc | [
"MIT"
] | 23 | 2020-05-16T23:47:17.000Z | 2022-03-24T17:05:23.000Z | result2bvh.py | DK-Jang/human_motion_manifold | dd3b603b892d66685204909c8818f3e1621ab7dc | [
"MIT"
] | 3 | 2020-06-24T07:05:29.000Z | 2021-04-29T04:23:56.000Z | result2bvh.py | DK-Jang/human_motion_manifold | dd3b603b892d66685204909c8818f3e1621ab7dc | [
"MIT"
] | 1 | 2021-05-04T08:30:43.000Z | 2021-05-04T08:30:43.000Z | import sys
import os
import numpy as np
import h5py
sys.path.append('./utils_motion')
from Animation import Animation, positions_global
from Quaternions import Quaternions
from BVH import save
from skeleton import Skeleton
import argparse
offsets = np.array([
[ 0. , 0. , 0. ],
[-13... | 35.299065 | 88 | 0.426529 | import sys
import os
import numpy as np
import h5py
sys.path.append('./utils_motion')
from Animation import Animation, positions_global
from Quaternions import Quaternions
from BVH import save
from skeleton import Skeleton
import argparse
offsets = np.array([
[ 0. , 0. , 0. ],
[-13... | true | true |
1c07dd30c1bc7ac1525fdc2ee72681859c4fa886 | 4,964 | py | Python | electrum_spectrumcash/gui/kivy/uix/dialogs/invoices.py | Spectrumcash/Spectrum-ElectromX-Client | 1008c9844eb99e70372850f9bb81d6ded3e59396 | [
"MIT"
] | null | null | null | electrum_spectrumcash/gui/kivy/uix/dialogs/invoices.py | Spectrumcash/Spectrum-ElectromX-Client | 1008c9844eb99e70372850f9bb81d6ded3e59396 | [
"MIT"
] | 2 | 2021-06-01T22:49:23.000Z | 2021-11-15T17:47:55.000Z | electrum_spectrumcash/gui/kivy/uix/dialogs/invoices.py | Spectrumcash/Spectrum-ElectrumX-Client | 1008c9844eb99e70372850f9bb81d6ded3e59396 | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from decimal import Decimal
Builder.load_string('''
<InvoicesLabel@Label>
#color: .305, .309, .309, 1
text_size: self.width, None
halign: 'left'
valign: 'top'
<InvoiceItem... | 29.2 | 105 | 0.590048 | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from decimal import Decimal
Builder.load_string('''
<InvoicesLabel@Label>
#color: .305, .309, .309, 1
text_size: self.width, None
halign: 'left'
valign: 'top'
<InvoiceItem... | true | true |
1c07dd4a146eece2870b28ffe521b30dc9d9ce68 | 6,204 | py | Python | tests/properties_tests/transformers_tests/to_cnf_tests.py | nathzi1505/DNNV | 16c6e6ecb681ce66196f9274d4a43eede8686319 | [
"MIT"
] | 33 | 2019-12-13T18:54:52.000Z | 2021-11-16T06:29:29.000Z | tests/properties_tests/transformers_tests/to_cnf_tests.py | nathzi1505/DNNV | 16c6e6ecb681ce66196f9274d4a43eede8686319 | [
"MIT"
] | 28 | 2020-01-30T14:06:03.000Z | 2022-01-27T01:07:37.000Z | tests/properties_tests/transformers_tests/to_cnf_tests.py | nathzi1505/DNNV | 16c6e6ecb681ce66196f9274d4a43eede8686319 | [
"MIT"
] | 14 | 2020-04-08T01:57:00.000Z | 2021-11-26T09:35:02.000Z | import unittest
from dnnv.properties import *
from dnnv.properties.context import get_context
class ToCNFTests(unittest.TestCase):
def reset_property_context(self):
get_context().reset()
def setUp(self):
self.reset_property_context()
def test_and(self):
a = Symbol("a")
b... | 33.901639 | 107 | 0.436493 | import unittest
from dnnv.properties import *
from dnnv.properties.context import get_context
class ToCNFTests(unittest.TestCase):
def reset_property_context(self):
get_context().reset()
def setUp(self):
self.reset_property_context()
def test_and(self):
a = Symbol("a")
b... | true | true |
1c07ddeb35c6cfc8c1a86a127e74832e1cafb939 | 6,661 | py | Python | examples/site1/client.py | dushuai2/secscan-authcheck | 25421e07748a58e133f1bb3a68416e481ee11cf1 | [
"Apache-2.0"
] | null | null | null | examples/site1/client.py | dushuai2/secscan-authcheck | 25421e07748a58e133f1bb3a68416e481ee11cf1 | [
"Apache-2.0"
] | null | null | null | examples/site1/client.py | dushuai2/secscan-authcheck | 25421e07748a58e133f1bb3a68416e481ee11cf1 | [
"Apache-2.0"
] | null | null | null | import time
from werkzeug.utils import cached_property
from flask import Flask, redirect, url_for, session, request, jsonify, abort, render_template
from flask_oauthlib.client import OAuth
accounts = [
{'id': '1', 'username': 'admin', 'password': '123456'},
{'id': '2', 'username': 'normal', 'password': '123456... | 32.651961 | 101 | 0.574989 | import time
from werkzeug.utils import cached_property
from flask import Flask, redirect, url_for, session, request, jsonify, abort, render_template
from flask_oauthlib.client import OAuth
accounts = [
{'id': '1', 'username': 'admin', 'password': '123456'},
{'id': '2', 'username': 'normal', 'password': '123456... | true | true |
1c07de47d142b697887f20ae2b001e4adce535ab | 3,081 | py | Python | scripts/extract-plural-forms.py | Lin-Buo-Ren/poedit | b9f09e4b7a0fc798f157e221162ec046f5facb9c | [
"MIT"
] | null | null | null | scripts/extract-plural-forms.py | Lin-Buo-Ren/poedit | b9f09e4b7a0fc798f157e221162ec046f5facb9c | [
"MIT"
] | null | null | null | scripts/extract-plural-forms.py | Lin-Buo-Ren/poedit | b9f09e4b7a0fc798f157e221162ec046f5facb9c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Update plural forms expressions from the data collected by Unicode Consortium
# (see http://www.unicode.org/cldr/charts/supplemental/language_plural_rules.html),
# but from a JSON version by Transifex folks
import os.path
import sys
import urllib.request
import re
import gettext
import json
i... | 34.233333 | 119 | 0.647842 |
import os.path
import sys
import urllib.request
import re
import gettext
import json
import subprocess
from tempfile import TemporaryDirectory
import xml.etree.ElementTree as ET
TABLE_URL = "https://www.unicode.org/repos/cldr/tags/latest/common/supplemental/plurals.xml"
MARKER_BEGIN = "// Code generated with scrip... | true | true |
1c07de826ffc32df621e09a3bb6e0a9c26f1f995 | 3,902 | py | Python | gnuradio-3.7.13.4/gr-blocks/python/blocks/qa_vector_map.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | 1 | 2021-03-09T07:32:37.000Z | 2021-03-09T07:32:37.000Z | gnuradio-3.7.13.4/gr-blocks/python/blocks/qa_vector_map.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | gnuradio-3.7.13.4/gr-blocks/python/blocks/qa_vector_map.py | v1259397/cosmic-gnuradio | 64c149520ac6a7d44179c3f4a38f38add45dd5dc | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your optio... | 37.519231 | 75 | 0.593542 |
from gnuradio import gr, gr_unittest, blocks
import math
class test_vector_map(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()
def tearDown(self):
self.tb = None
def test_reversing(self):
N = 5
src_data = range(0, 20)
expected_result = []... | true | true |
1c07e02cd81f5e4ff6e18f136ed3b0318e1f7d6c | 1,952 | py | Python | src/azure-cli/azure/cli/command_modules/appservice/_constants.py | digimaun/azure-cli | 298994660f0fde6863cb45a7c3142141ed10f923 | [
"MIT"
] | 1 | 2020-12-12T02:53:24.000Z | 2020-12-12T02:53:24.000Z | src/azure-cli/azure/cli/command_modules/appservice/_constants.py | digimaun/azure-cli | 298994660f0fde6863cb45a7c3142141ed10f923 | [
"MIT"
] | 1 | 2021-06-02T04:24:22.000Z | 2021-06-02T04:24:22.000Z | src/azure-cli/azure/cli/command_modules/appservice/_constants.py | digimaun/azure-cli | 298994660f0fde6863cb45a7c3142141ed10f923 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 31.483871 | 114 | 0.525615 |
NODE_VERSION_DEFAULT = "10.14"
NETCORE_VERSION_DEFAULT = "2.2"
DOTNET_VERSION_DEFAULT = "4.7"
PYTHON_VERSION_DEFAULT = "3.7"
NETCORE_RUNTIME_NAME = "dotnetcore"
DOTNET_RUNTIME_NAME = "aspnet"
NODE_RUNTIME_NAME = "node"
PYTHON_RUNTIME_NAME = "python"
OS_DEFAULT = "Windows"
STATIC_RUNTIME_NAME = "static" NODE_VERSIONS ... | true | true |
1c07e032f3741deacc24ba95ec7a62a13c5e1c25 | 730 | py | Python | packages/athena/setup.py | abhishek-khare/soda-sql | 78bae4c223b3e04012049d72b14146bd19c71954 | [
"Apache-2.0"
] | null | null | null | packages/athena/setup.py | abhishek-khare/soda-sql | 78bae4c223b3e04012049d72b14146bd19c71954 | [
"Apache-2.0"
] | null | null | null | packages/athena/setup.py | abhishek-khare/soda-sql | 78bae4c223b3e04012049d72b14146bd19c71954 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
from setuptools import setup, find_namespace_packages
if sys.version_info < (3, 7):
print('Error: Soda SQL requires at least Python 3.7')
print('Error: Please upgrade your Python version to 3.7 or later')
sys.exit(1)
package_name = "soda-sql-athena"
package_version = '2.1.... | 27.037037 | 82 | 0.728767 | import sys
from setuptools import setup, find_namespace_packages
if sys.version_info < (3, 7):
print('Error: Soda SQL requires at least Python 3.7')
print('Error: Please upgrade your Python version to 3.7 or later')
sys.exit(1)
package_name = "soda-sql-athena"
package_version = '2.1.0b12'
description = "S... | true | true |
1c07e0ac4418e67e69ea6874445f10e711596b72 | 2,378 | py | Python | Python/sort_array_parity.py | anu-ka/coding-problems | 2f48017cc734d7de81d62042ba385ead709f0ca7 | [
"MIT"
] | null | null | null | Python/sort_array_parity.py | anu-ka/coding-problems | 2f48017cc734d7de81d62042ba385ead709f0ca7 | [
"MIT"
] | null | null | null | Python/sort_array_parity.py | anu-ka/coding-problems | 2f48017cc734d7de81d62042ba385ead709f0ca7 | [
"MIT"
] | null | null | null | # https://leetcode.com/explore/challenge/card/september-leetcoding-challenge-2021/639/week-4-september-22nd-september-28th/3990/
# Given an array of integers nums, half of the integers in nums are odd, and the other half are even.
# Sort the array so that whenever nums[i] is odd, i is odd, and whenever nums[i] is even,... | 30.487179 | 128 | 0.429773 |
import pytest
class Solution:
def sortArrayByParityII(self, nums: list[int]) -> list[int]:
odd = []
even = []
for i in nums:
if i % 2 == 0:
even.append(i)
else:
odd.append(i)
i = 0
result = []
while i < len(ev... | true | true |
1c07e1012ebe59c853010bd53134a5db254687b1 | 2,228 | py | Python | federatedml/feature/test/one_hot_test.py | chenj133/FATE | 7065fc73ab83f83e699efec69ff8efb499159ef4 | [
"Apache-2.0"
] | 3 | 2019-10-18T02:22:05.000Z | 2019-10-18T02:22:42.000Z | federatedml/feature/test/one_hot_test.py | chenj133/FATE | 7065fc73ab83f83e699efec69ff8efb499159ef4 | [
"Apache-2.0"
] | 14 | 2020-01-28T23:02:45.000Z | 2022-02-10T00:22:08.000Z | federatedml/feature/test/one_hot_test.py | chenj133/FATE | 7065fc73ab83f83e699efec69ff8efb499159ef4 | [
"Apache-2.0"
] | 2 | 2019-09-05T02:32:05.000Z | 2019-09-17T10:30:48.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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/lic... | 31.380282 | 75 | 0.633752 |
import unittest
from arch.api import eggroll
eggroll.init("123")
from federatedml.feature.one_hot_encoder import OneHotEncoder
from federatedml.feature.instance import Instance
import numpy as np
class TestOneHotEncoder(unittest.TestCase):
def setUp(self):
self.data_num = 100
self.feature_num... | true | true |
1c07e2faf6c51c459d0aee8d7f199cdc31897cfe | 1,038 | py | Python | oceanbolt/com/congestion_v3/types/__init__.py | oceanbolt/oceanbolt-python-sdk | c03c400fb7861a7918c6d18d39ad7a108a72baab | [
"MIT"
] | 8 | 2021-04-15T08:43:55.000Z | 2021-12-21T09:23:58.000Z | oceanbolt/com/congestion_v3/types/__init__.py | oceanbolt/oceanbolt-python-sdk | c03c400fb7861a7918c6d18d39ad7a108a72baab | [
"MIT"
] | null | null | null | oceanbolt/com/congestion_v3/types/__init__.py | oceanbolt/oceanbolt-python-sdk | c03c400fb7861a7918c6d18d39ad7a108a72baab | [
"MIT"
] | 2 | 2022-01-16T11:43:51.000Z | 2022-03-24T19:26:44.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 26.615385 | 74 | 0.728324 |
from .service import (
EmptyParams,
EmptyResponse,
GetCongestionRequest,
CongestionTimeseriesGroup,
CongestionTimeseriesRow,
CongestionResponse,
CongestionSplitRow,
CongestionStay,
)
__all__ = (
'EmptyParams',
'EmptyResponse',
'GetCongestionRequest',
'CongestionTimeser... | true | true |
1c07e30afb0683c80115b6af1ec4367c216d9a91 | 5,788 | py | Python | app/views.py | Speed3s/AuctionWeb | 757d8535aefe2b56b1d47c88090fd603540aeb5b | [
"CC0-1.0"
] | 1 | 2019-12-17T18:34:56.000Z | 2019-12-17T18:34:56.000Z | app/views.py | Speed3s/AuctionWeb | 757d8535aefe2b56b1d47c88090fd603540aeb5b | [
"CC0-1.0"
] | 7 | 2020-02-12T03:13:21.000Z | 2022-03-12T00:09:09.000Z | app/views.py | Speed3s/AuctionWeb | 757d8535aefe2b56b1d47c88090fd603540aeb5b | [
"CC0-1.0"
] | null | null | null | from datetime import datetime
from django.shortcuts import render, redirect
from django.template.loader import render_to_string
from django.http import JsonResponse, HttpResponse, Http404, QueryDict
from django.db import IntegrityError
from django.contrib.auth import (authenticate, get_user_model, login, logout,)
from ... | 37.830065 | 144 | 0.664997 | from datetime import datetime
from django.shortcuts import render, redirect
from django.template.loader import render_to_string
from django.http import JsonResponse, HttpResponse, Http404, QueryDict
from django.db import IntegrityError
from django.contrib.auth import (authenticate, get_user_model, login, logout,)
from ... | true | true |
1c07e36a699f57417c57154253fb3e2ba924c74e | 783 | py | Python | thefuck/rules/ln_s_order.py | juzim/thefuck | a3b2e6872b9e75b8a259375b9440246fdd181565 | [
"MIT"
] | 1 | 2018-07-06T04:10:56.000Z | 2018-07-06T04:10:56.000Z | thefuck/rules/ln_s_order.py | juzim/thefuck | a3b2e6872b9e75b8a259375b9440246fdd181565 | [
"MIT"
] | 4 | 2020-12-23T15:44:08.000Z | 2020-12-23T16:48:59.000Z | thefuck/rules/ln_s_order.py | juzim/thefuck | a3b2e6872b9e75b8a259375b9440246fdd181565 | [
"MIT"
] | 1 | 2019-12-08T19:23:06.000Z | 2019-12-08T19:23:06.000Z | import os
from thefuck.specific.sudo import sudo_support
def _get_destination(script_parts):
"""When arguments order is wrong first argument will be destination."""
for part in script_parts:
if part not in {'ln', '-s', '--symbolic'} and os.path.exists(part):
return part
@sudo_support
def... | 29 | 75 | 0.685824 | import os
from thefuck.specific.sudo import sudo_support
def _get_destination(script_parts):
for part in script_parts:
if part not in {'ln', '-s', '--symbolic'} and os.path.exists(part):
return part
@sudo_support
def match(command):
return (command.script_parts[0] == 'ln'
and... | true | true |
1c07e4ce53459fcf91565d3dc0edd1e438858eb0 | 7,751 | py | Python | vimfiles/bundle/vim-python/pymode/libs/logilab-common-1.4.1/test/unittest_registry.py | guantau/vimrc | 4f4bbe59ee84f7d7ae7388f660b601640cfde0fe | [
"MIT"
] | 1 | 2022-02-09T15:48:13.000Z | 2022-02-09T15:48:13.000Z | vimfiles/bundle/vim-python/pymode/libs/logilab-common-1.4.1/test/unittest_registry.py | guantau/vimrc | 4f4bbe59ee84f7d7ae7388f660b601640cfde0fe | [
"MIT"
] | null | null | null | vimfiles/bundle/vim-python/pymode/libs/logilab-common-1.4.1/test/unittest_registry.py | guantau/vimrc | 4f4bbe59ee84f7d7ae7388f660b601640cfde0fe | [
"MIT"
] | 1 | 2022-02-09T15:49:18.000Z | 2022-02-09T15:49:18.000Z | # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of Logilab-Common.
#
# Logilab-Common is free software: you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as publ... | 35.072398 | 85 | 0.612953 |
import gc
import logging
import os.path as osp
import sys
from operator import eq, lt, le, gt
from contextlib import contextmanager
import warnings
logging.basicConfig(level=logging.ERROR)
from logilab.common.testlib import TestCase, unittest_main
from logilab.common.registry import *
class _1_(Predicate):
de... | true | true |
1c07e4e29935d599703607bb13fcae1cf2f5cb7b | 709 | py | Python | Section_3/Exercise_11.py | Szymon-Budziak/WDI_exercises_solutions | 51ffc9ec8b3cd6809bd55e98ecb8aed759c2d460 | [
"MIT"
] | null | null | null | Section_3/Exercise_11.py | Szymon-Budziak/WDI_exercises_solutions | 51ffc9ec8b3cd6809bd55e98ecb8aed759c2d460 | [
"MIT"
] | null | null | null | Section_3/Exercise_11.py | Szymon-Budziak/WDI_exercises_solutions | 51ffc9ec8b3cd6809bd55e98ecb8aed759c2d460 | [
"MIT"
] | 1 | 2021-11-21T09:38:33.000Z | 2021-11-21T09:38:33.000Z | """
Napisać funkcję, która dla N-elementowej tablicy t wypełnionej liczbami naturalnym wyznacza
długość najdłuższego, spójnego podciągu geometrycznego.
"""
from random import randint
def find_the_longest_conseq_subseq():
t = list()
N = 1000
i = 0
summary = 0
count = 0
ans = 0
for _ in rang... | 20.852941 | 91 | 0.551481 | from random import randint
def find_the_longest_conseq_subseq():
t = list()
N = 1000
i = 0
summary = 0
count = 0
ans = 0
for _ in range(1, N):
x = randint(1, N)
if x not in t:
t.append(x)
else:
N -= 1
t.sort()
for element in t:
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.