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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0988c73e37b5c190c253777f2e1a7b2aaec183 | 751 | py | Python | modules/socket.py | HondaLab/Manual-Control-Robot | 53a662fcaca40ea08eebf8daba2367d63c2eff67 | [
"MIT"
] | null | null | null | modules/socket.py | HondaLab/Manual-Control-Robot | 53a662fcaca40ea08eebf8daba2367d63c2eff67 | [
"MIT"
] | 1 | 2022-03-19T03:35:25.000Z | 2022-03-19T03:35:25.000Z | modules/socket.py | HondaLab/Manual-Control-Robot | 53a662fcaca40ea08eebf8daba2367d63c2eff67 | [
"MIT"
] | null | null | null | import socket
robot = '172.16.8.122'
port = 50001
class UDP_Send():
def __init__(self,addr,port):
self.sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
self.addr = addr
self.port = port
def send(self,lis):
strig = ''
num = len(lis)
i = 0
while i<num:
strig = strig + str("%12.8f"%lis[i])
if... | 22.757576 | 63 | 0.6498 | import socket
robot = '172.16.8.122'
port = 50001
class UDP_Send():
def __init__(self,addr,port):
self.sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
self.addr = addr
self.port = port
def send(self,lis):
strig = ''
num = len(lis)
i = 0
while i<num:
strig = strig + str("%12.8f"%lis[i])
if... | true | true |
1c0988ce431bd8e02ffac7f3a2dd43ea1423187b | 4,745 | py | Python | test/functional/wallet_reorgsrestore.py | qtdatainc/SAM-Coin | 3ff99809c5ce6ddad10d29fef688cd54f0ee37fb | [
"MIT"
] | 1 | 2022-02-22T03:37:26.000Z | 2022-02-22T03:37:26.000Z | test/functional/wallet_reorgsrestore.py | qtdatainc/SAM-Coin | 3ff99809c5ce6ddad10d29fef688cd54f0ee37fb | [
"MIT"
] | null | null | null | test/functional/wallet_reorgsrestore.py | qtdatainc/SAM-Coin | 3ff99809c5ce6ddad10d29fef688cd54f0ee37fb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2019-2020 The Samcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test tx status in case of reorgs while wallet being shutdown.
Wallet txn status rely on block connect... | 46.067961 | 176 | 0.704531 |
from decimal import Decimal
import os
import shutil
from test_framework.test_framework import SamcoinTestFramework
from test_framework.util import (
assert_equal,
)
class ReorgsRestoreTest(SamcoinTestFramework):
def set_test_params(self):
self.num_nodes = 3
def skip_test_if_missing_module(s... | true | true |
1c098962a867a9249c60d7874152d7374bb91aef | 8,188 | py | Python | openstack/tests/unit/cloud/test_operator_noauth.py | NeCTAR-RC/openstacksdk | 60a24f6c4717a1f9a0e545c9a07e68afaedc5a27 | [
"Apache-2.0"
] | 99 | 2018-03-28T15:41:45.000Z | 2022-01-23T17:22:13.000Z | openstack/tests/unit/cloud/test_operator_noauth.py | NeCTAR-RC/openstacksdk | 60a24f6c4717a1f9a0e545c9a07e68afaedc5a27 | [
"Apache-2.0"
] | 5 | 2018-05-25T16:54:23.000Z | 2021-11-21T02:27:16.000Z | openstack/tests/unit/cloud/test_operator_noauth.py | NeCTAR-RC/openstacksdk | 60a24f6c4717a1f9a0e545c9a07e68afaedc5a27 | [
"Apache-2.0"
] | 104 | 2018-04-06T14:33:54.000Z | 2022-03-01T01:58:09.000Z | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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... | 37.907407 | 77 | 0.536028 |
import openstack.cloud
from openstack.tests.unit import base
class TestOpenStackCloudOperatorNoAuth(base.TestCase):
def setUp(self):
super(TestOpenStackCloudOperatorNoAuth, self).setUp()
self._uri_registry.clear()
self.register_uris([
dict(method='GET',
... | true | true |
1c0989e02f3fdcd8299946f4633d2c6ac7efd952 | 736 | py | Python | imagemks/__init__.py | SvenPVoigt/ImageMKS | 7daa8329171c8e3e9cfe379043c7bf3d02950733 | [
"MIT"
] | null | null | null | imagemks/__init__.py | SvenPVoigt/ImageMKS | 7daa8329171c8e3e9cfe379043c7bf3d02950733 | [
"MIT"
] | null | null | null | imagemks/__init__.py | SvenPVoigt/ImageMKS | 7daa8329171c8e3e9cfe379043c7bf3d02950733 | [
"MIT"
] | null | null | null | from . import filters
from . import masking
from . import structures
from . import visualization
from . import workflows
def get_version():
"""Get the version of the code from egg_info.
Returns:
the package version number
"""
from pkg_resources import get_distribution, DistributionNotFound
t... | 25.37931 | 94 | 0.657609 | from . import filters
from . import masking
from . import structures
from . import visualization
from . import workflows
def get_version():
from pkg_resources import get_distribution, DistributionNotFound
try:
version = get_distribution(__name__.split('.')[0]).version except DistributionNotFound: ... | true | true |
1c0989e695484582adcdc47c703a10a8b99c03a7 | 1,378 | py | Python | file_handler.py | gnkampou/Crawler-Indexer | 277d30fdf3ed97e999b64bedda46be9106fd5785 | [
"Apache-2.0"
] | 1 | 2020-12-10T11:53:47.000Z | 2020-12-10T11:53:47.000Z | file_handler.py | gnkampou/Crawler-Indexer | 277d30fdf3ed97e999b64bedda46be9106fd5785 | [
"Apache-2.0"
] | null | null | null | file_handler.py | gnkampou/Crawler-Indexer | 277d30fdf3ed97e999b64bedda46be9106fd5785 | [
"Apache-2.0"
] | 6 | 2020-12-08T20:24:48.000Z | 2021-02-07T15:14:37.000Z | import os
# create a folder that's starts from a homepage that handles the websites
def create_proj_directory(directory):
if not os.path.exists(directory):
print('Creating directory ' + directory)
os.makedirs(directory)
# Create queue and crawled files (if not created).Use the write_to_file meth... | 29.956522 | 83 | 0.679245 | import os
def create_proj_directory(directory):
if not os.path.exists(directory):
print('Creating directory ' + directory)
os.makedirs(directory)
# Create queue and crawled files (if not created).Use the write_to_file method.
def create_files(project, first_url):
pages_in_queue = os.path.joi... | true | true |
1c0989ecf00d7b3296eb6dff1b0a9f35c1d86d89 | 992 | py | Python | seemmo/baseThread-depre.py | Prymon/simple-url-proxy | 6c83bb1a6f6683b5516eeef3eeceadb4f8141aa7 | [
"Apache-2.0"
] | null | null | null | seemmo/baseThread-depre.py | Prymon/simple-url-proxy | 6c83bb1a6f6683b5516eeef3eeceadb4f8141aa7 | [
"Apache-2.0"
] | null | null | null | seemmo/baseThread-depre.py | Prymon/simple-url-proxy | 6c83bb1a6f6683b5516eeef3eeceadb4f8141aa7 | [
"Apache-2.0"
] | null | null | null | import logging
import mapping
import traceback
import time
import ctypes
from threading import Thread
from Queue import Empty as QueueEmpty, Full as QueueFull
__author__ = 'wct'
class BaseThread(Thread):
def __init__(self):
Thread.__init__(self)
self.isStop = False
def stop(sel... | 23.619048 | 95 | 0.576613 | import logging
import mapping
import traceback
import time
import ctypes
from threading import Thread
from Queue import Empty as QueueEmpty, Full as QueueFull
__author__ = 'wct'
class BaseThread(Thread):
def __init__(self):
Thread.__init__(self)
self.isStop = False
def stop(sel... | true | true |
1c098a0661f235f26ebe62463aa34282439bd7e5 | 15,643 | py | Python | ppapi/generators/idl_gen_wrapper.py | iplo/Chain | 8bc8943d66285d5258fffc41bed7c840516c4422 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | ppapi/generators/idl_gen_wrapper.py | JasonEric/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2017-02-14T21:55:58.000Z | 2017-02-14T21:55:58.000Z | ppapi/generators/idl_gen_wrapper.py | JasonEric/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Base class for generating wrapper functions for PPAPI methods.
"""
from datetime import datetime
import os
import sys
from idl_c_proto import CGen
f... | 34.762222 | 80 | 0.642268 |
from datetime import datetime
import os
import sys
from idl_c_proto import CGen
from idl_generator import Generator
from idl_log import ErrOut, InfoOut, WarnOut
from idl_option import GetOption
from idl_outfile import IDLOutFile
class PPKind(object):
@staticmethod
def ChoosePPFunc(iface, ppb_func, ppp_func):
... | true | true |
1c098b05054192e5980e0db06230b1f7e45a5707 | 26,250 | py | Python | backend/api/python_http_client/kfp_server_api/api_client.py | tomar27/pipelines | fc6a2761b3770cb3b854115b841c1a50876665c3 | [
"Apache-2.0"
] | 1 | 2021-11-22T12:22:14.000Z | 2021-11-22T12:22:14.000Z | backend/api/python_http_client/kfp_server_api/api_client.py | tomar27/pipelines | fc6a2761b3770cb3b854115b841c1a50876665c3 | [
"Apache-2.0"
] | 13 | 2021-07-06T06:47:43.000Z | 2022-03-08T23:35:13.000Z | backend/api/python_http_client/kfp_server_api/api_client.py | tomar27/pipelines | fc6a2761b3770cb3b854115b841c1a50876665c3 | [
"Apache-2.0"
] | 3 | 2022-01-10T13:40:24.000Z | 2022-03-21T08:46:14.000Z | # coding: utf-8
"""
Kubeflow Pipelines API
This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition.
Contact: kubeflow-pipelines@google.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import at... | 39.355322 | 124 | 0.55299 |
from __future__ import absolute_import
import atexit
import datetime
from dateutil.parser import parse
import json
import mimetypes
from multiprocessing.pool import ThreadPool
import os
import re
import tempfile
import six
from six.moves.urllib.parse import quote
from kfp_server_api.configuration import Configurati... | true | true |
1c098b3c7b88df1d34beb025724b50e77b27581c | 1,981 | py | Python | biobb_common/command_wrapper/cmd_wrapper.py | bioexcel/biobb_common | b59a73057fd1318ad165af6beac446cb3f73a9b6 | [
"Apache-2.0"
] | null | null | null | biobb_common/command_wrapper/cmd_wrapper.py | bioexcel/biobb_common | b59a73057fd1318ad165af6beac446cb3f73a9b6 | [
"Apache-2.0"
] | 5 | 2019-02-27T11:23:13.000Z | 2021-10-14T14:13:52.000Z | biobb_common/command_wrapper/cmd_wrapper.py | bioexcel/biobb_common | b59a73057fd1318ad165af6beac446cb3f73a9b6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Python wrapper for command line
"""
import os
import subprocess
from biobb_common.tools import file_utils as fu
import typing
import logging
class CmdWrapper:
"""Command line wrapper using subprocess library
"""
def __init__(self, cmd: typing.Iterable[str], out_log: logging.Log... | 33.016667 | 113 | 0.550732 | import os
import subprocess
from biobb_common.tools import file_utils as fu
import typing
import logging
class CmdWrapper:
def __init__(self, cmd: typing.Iterable[str], out_log: logging.Logger = None, err_log: logging.Logger = None,
global_log: logging.Logger = None, env: typing.MutableMapping =... | true | true |
1c098bba1f392abb528b78bf27187b3f72a2aac7 | 834 | py | Python | mmcls/version.py | Miles-Ma/mmclassification | b54acfd5c431bf3a15a964c9d3d9a271c197ac18 | [
"Apache-2.0"
] | null | null | null | mmcls/version.py | Miles-Ma/mmclassification | b54acfd5c431bf3a15a964c9d3d9a271c197ac18 | [
"Apache-2.0"
] | null | null | null | mmcls/version.py | Miles-Ma/mmclassification | b54acfd5c431bf3a15a964c9d3d9a271c197ac18 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Open-MMLab. All rights reserved.
__version__ = '0.14.0'
def parse_version_info(version_str):
"""Parse a version string into a tuple.
Args:
version_str (str): The version string.
Returns:
tuple[int | str]: The version info, e.g., "1.3.0" is parsed into
(1, 3, 0... | 28.758621 | 72 | 0.606715 |
__version__ = '0.14.0'
def parse_version_info(version_str):
version_info = []
for x in version_str.split('.'):
if x.isdigit():
version_info.append(int(x))
elif x.find('rc') != -1:
patch_version = x.split('rc')
version_info.append(int(patch_version[0]))
... | true | true |
1c098bc37783f63a38926235640dab45738913d4 | 727 | py | Python | sample.py | tshirai/raspi-sensor | ba5a39a793e8d301e22f2da51a8653f28f38c6b4 | [
"MIT"
] | null | null | null | sample.py | tshirai/raspi-sensor | ba5a39a793e8d301e22f2da51a8653f28f38c6b4 | [
"MIT"
] | null | null | null | sample.py | tshirai/raspi-sensor | ba5a39a793e8d301e22f2da51a8653f28f38c6b4 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
"""
See https://developers.google.com/sheets/api/quickstart/python
"""
from helper import get_spreadsheets, SHEET_ID
def sample():
SAMPLE_RANGE_NAME = 'Class Data!A2:E'
sheets = get_spreadsheets()
# Call the Sheets API
result = sheets.values().get(spreadsheetId=SHEET_ID,
... | 22.71875 | 73 | 0.591472 | from helper import get_spreadsheets, SHEET_ID
def sample():
SAMPLE_RANGE_NAME = 'Class Data!A2:E'
sheets = get_spreadsheets()
result = sheets.values().get(spreadsheetId=SHEET_ID,
range=SAMPLE_RANGE_NAME).execute()
values = result.get('values', [])
if not valu... | true | true |
1c098c1c334002774a83d0424ca54a9f27e72c8c | 918 | py | Python | binarysearch.io/second_place.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 2 | 2020-06-25T21:10:32.000Z | 2020-12-10T06:53:45.000Z | binarysearch.io/second_place.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | null | null | null | binarysearch.io/second_place.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 3 | 2020-05-15T14:17:09.000Z | 2021-07-25T13:18:20.000Z | """
Problem Link: https://binarysearch.io/problems/Second-Place
"""
# class Tree:
# def __init__(self, val, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def solve(self, root):
# Write your code here
if root is None:
... | 27 | 65 | 0.442266 | class Solution:
def solve(self, root):
if root is None:
return None
nodes = []
nodes.append(root)
count = 0
prev = 0
now = 0
while nodes:
new = []
flag = True
for node in nodes:
if fla... | true | true |
1c098c887797dca8c4d7980e725ae2079332d929 | 1,985 | py | Python | report_results/fig2p1_aliasing_example.py | ebezzam/frius | c3acc98288c949085b7dea08ef3708581f86ce25 | [
"MIT"
] | null | null | null | report_results/fig2p1_aliasing_example.py | ebezzam/frius | c3acc98288c949085b7dea08ef3708581f86ce25 | [
"MIT"
] | null | null | null | report_results/fig2p1_aliasing_example.py | ebezzam/frius | c3acc98288c949085b7dea08ef3708581f86ce25 | [
"MIT"
] | 1 | 2018-11-26T10:10:33.000Z | 2018-11-26T10:10:33.000Z | import numpy as np
import os
from scipy.io import wavfile
import plot_settings
import matplotlib.pyplot as plt
duration = 0.5
ultrasound_freq = 30e3
ultrasound_alias = 48e3-ultrasound_freq
samp_freq, signal = wavfile.read(os.path.join(os.path.dirname(__file__), "speech_48k.wav"))
signal = signal[:int(duration*samp_f... | 25.779221 | 91 | 0.723929 | import numpy as np
import os
from scipy.io import wavfile
import plot_settings
import matplotlib.pyplot as plt
duration = 0.5
ultrasound_freq = 30e3
ultrasound_alias = 48e3-ultrasound_freq
samp_freq, signal = wavfile.read(os.path.join(os.path.dirname(__file__), "speech_48k.wav"))
signal = signal[:int(duration*samp_f... | true | true |
1c098c9a9dca081c2481bdcc83d50feb493a9735 | 6,378 | py | Python | lib/segmenter.py | skimotv/SkimoTextSummarizer | b58cf5dd2a09cb7b5530c161781a579807143231 | [
"MIT"
] | 1 | 2020-11-23T18:06:39.000Z | 2020-11-23T18:06:39.000Z | lib/segmenter.py | skimotv/SkimoTextSummarizer | b58cf5dd2a09cb7b5530c161781a579807143231 | [
"MIT"
] | null | null | null | lib/segmenter.py | skimotv/SkimoTextSummarizer | b58cf5dd2a09cb7b5530c161781a579807143231 | [
"MIT"
] | null | null | null | from lib.utils import remove_stopwords
from spacy.attrs import ORTH
from operator import itemgetter
class Segmenter:
def __init__(self, transcript_list):
self.transcript_list = transcript_list
self.segments = []
self.MIN_SIMILARITY = 0.7
def run_segmenter(self):
"""
Dr... | 44.601399 | 116 | 0.669646 | from lib.utils import remove_stopwords
from spacy.attrs import ORTH
from operator import itemgetter
class Segmenter:
def __init__(self, transcript_list):
self.transcript_list = transcript_list
self.segments = []
self.MIN_SIMILARITY = 0.7
def run_segmenter(self):
self.segments ... | true | true |
1c098cd1d1966f5aaa18769d83650a9d80744547 | 52,068 | py | Python | nova/tests/unit/compute/test_compute_utils.py | Juniper/nova | f7876474846be4b32070cc33c29535a4174aca7f | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/compute/test_compute_utils.py | Juniper/nova | f7876474846be4b32070cc33c29535a4174aca7f | [
"Apache-2.0"
] | 2 | 2015-02-03T06:25:24.000Z | 2015-02-04T10:10:36.000Z | nova/tests/unit/compute/test_compute_utils.py | Juniper/nova | f7876474846be4b32070cc33c29535a4174aca7f | [
"Apache-2.0"
] | 7 | 2015-01-20T10:30:08.000Z | 2020-02-05T10:29:05.000Z | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | 44.013525 | 79 | 0.610817 |
import copy
import string
import uuid
import mock
import six
from nova.compute import flavors
from nova.compute import manager
from nova.compute import power_state
from nova.compute import task_states
from nova.compute import utils as compute_utils
import nova.conf
from nova import context
from nova import exceptio... | true | true |
1c098ce2e4a8963399451399605d5d712d7e9e9e | 635 | py | Python | guests/migrations/0010_auto_20160320_1338.py | markbackhouse/django-wedding-website | d2547d730fb8c91b41b82f1e211f4226430cf6ca | [
"Apache-2.0"
] | null | null | null | guests/migrations/0010_auto_20160320_1338.py | markbackhouse/django-wedding-website | d2547d730fb8c91b41b82f1e211f4226430cf6ca | [
"Apache-2.0"
] | null | null | null | guests/migrations/0010_auto_20160320_1338.py | markbackhouse/django-wedding-website | d2547d730fb8c91b41b82f1e211f4226430cf6ca | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-20 13:38
from __future__ import unicode_literals
from django.db import migrations, models
import guests.models
class Migration(migrations.Migration):
dependencies = [
("guests", "0009_guest_meal"),
]
operations = [
migrations.... | 22.678571 | 51 | 0.552756 | from __future__ import unicode_literals
from django.db import migrations, models
import guests.models
class Migration(migrations.Migration):
dependencies = [
("guests", "0009_guest_meal"),
]
operations = [
migrations.AlterField(
model_name="party",
name="invitati... | true | true |
1c098d3a9d828eb70d8f8e4e183ce015a2d10060 | 12,424 | py | Python | pyxform/tests/bug_tests.py | tedrick/pyxform | 00568d78f9c915f4c7f9dede7730aa86dbe1b36d | [
"BSD-2-Clause"
] | null | null | null | pyxform/tests/bug_tests.py | tedrick/pyxform | 00568d78f9c915f4c7f9dede7730aa86dbe1b36d | [
"BSD-2-Clause"
] | null | null | null | pyxform/tests/bug_tests.py | tedrick/pyxform | 00568d78f9c915f4c7f9dede7730aa86dbe1b36d | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Some tests for the new (v0.9) spec is properly implemented.
"""
import codecs
import os
import unittest2 as unittest
import pyxform
from pyxform.errors import PyXFormError
from pyxform.tests.utils import XFormTestCase
from pyxform.utils import has_external_choices
from pyxform.xls2json imp... | 39.566879 | 88 | 0.679008 | import codecs
import os
import unittest2 as unittest
import pyxform
from pyxform.errors import PyXFormError
from pyxform.tests.utils import XFormTestCase
from pyxform.utils import has_external_choices
from pyxform.xls2json import SurveyReader, parse_file_to_workbook_dict
from pyxform.xls2json_backends import xls_to_d... | true | true |
1c098de88d37d8296867f727b88dd9ae74c4f787 | 3,106 | py | Python | rlpytorch/runner/single_process.py | leonida/ELF | ef7a811811118ca579a74ec32ded5ed42d157ba1 | [
"BSD-3-Clause"
] | null | null | null | rlpytorch/runner/single_process.py | leonida/ELF | ef7a811811118ca579a74ec32ded5ed42d157ba1 | [
"BSD-3-Clause"
] | null | null | null | rlpytorch/runner/single_process.py | leonida/ELF | ef7a811811118ca579a74ec32ded5ed42d157ba1 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from ..args_provider import ArgsProvider
import tqdm
class SingleProcessRun:
def __init__(self):
''' Initi... | 32.354167 | 94 | 0.56407 |
from ..args_provider import ArgsProvider
import tqdm
class SingleProcessRun:
def __init__(self):
self.args = ArgsProvider(
call_from = self,
define_args = [
("num_minibatch", 5000),
("num_episode", 10000),
("tqdm", dict(action="store_... | true | true |
1c098f9b0b0dec57051b70f799973534a33efdc5 | 2,414 | py | Python | nlp/zemberek/preprocess_pb2_grpc.py | fatihint/lugatrap | 868bd34517eb325591eba96af8176bc4ad5b0fb6 | [
"Apache-2.0"
] | 1 | 2021-04-15T16:16:10.000Z | 2021-04-15T16:16:10.000Z | nlp/zemberek/preprocess_pb2_grpc.py | fatihint/lugatrap | 868bd34517eb325591eba96af8176bc4ad5b0fb6 | [
"Apache-2.0"
] | 1 | 2021-11-04T18:48:01.000Z | 2021-11-04T18:48:01.000Z | nlp/zemberek/preprocess_pb2_grpc.py | fatihint/lugatrap | 868bd34517eb325591eba96af8176bc4ad5b0fb6 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from . import preprocess_pb2 as preprocess__pb2
class PreprocessingServiceStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A ... | 37.71875 | 91 | 0.769677 | import grpc
from . import preprocess_pb2 as preprocess__pb2
class PreprocessingServiceStub(object):
pass
def __init__(self, channel):
self.Tokenize = channel.unary_unary(
'/zemberek.preprocessor.PreprocessingService/Tokenize',
request_serializer=preprocess__pb2.TokenizationRequest.Serializ... | true | true |
1c0991136ca43445d87e89a922ac7cd69ba2b7e5 | 694 | py | Python | extern/smplx_kinect/smplx_kinect/exp/arg_parser.py | wangxihao/rgbd-kinect-pose | 03180723c99759ba2500bcd42b5fe7a1d26eb507 | [
"MIT"
] | 1 | 2022-02-07T06:12:26.000Z | 2022-02-07T06:12:26.000Z | extern/smplx_kinect/smplx_kinect/exp/arg_parser.py | wangxihao/rgbd-kinect-pose | 03180723c99759ba2500bcd42b5fe7a1d26eb507 | [
"MIT"
] | null | null | null | extern/smplx_kinect/smplx_kinect/exp/arg_parser.py | wangxihao/rgbd-kinect-pose | 03180723c99759ba2500bcd42b5fe7a1d26eb507 | [
"MIT"
] | null | null | null | import argparse
import yaml
from copy import deepcopy
def parse_yaml(fp):
with open(fp, 'r') as f:
config = yaml.safe_load(f)
result = deepcopy(config)
return result
def parse_args_yaml():
parser = argparse.ArgumentParser()
parser.add_argument('--config', required=True)
parser.add_a... | 25.703704 | 78 | 0.701729 | import argparse
import yaml
from copy import deepcopy
def parse_yaml(fp):
with open(fp, 'r') as f:
config = yaml.safe_load(f)
result = deepcopy(config)
return result
def parse_args_yaml():
parser = argparse.ArgumentParser()
parser.add_argument('--config', required=True)
parser.add_a... | true | true |
1c099126900f26c507649eb164bb5cc3690f5480 | 7,768 | py | Python | test/test_cco_obj.py | gmdzy2010/mpi4py | 7f7a94760194e11ba72f8af2f49b7d1b37bd9343 | [
"BSD-2-Clause"
] | 533 | 2015-03-02T05:16:27.000Z | 2022-03-28T09:44:37.000Z | test/test_cco_obj.py | gmdzy2010/mpi4py | 7f7a94760194e11ba72f8af2f49b7d1b37bd9343 | [
"BSD-2-Clause"
] | 105 | 2017-09-17T07:50:33.000Z | 2022-03-29T17:27:43.000Z | test/test_cco_obj.py | gmdzy2010/mpi4py | 7f7a94760194e11ba72f8af2f49b7d1b37bd9343 | [
"BSD-2-Clause"
] | 98 | 2015-02-03T03:17:52.000Z | 2022-03-23T02:03:11.000Z | from mpi4py import MPI
import mpiunittest as unittest
from functools import reduce
cumsum = lambda seq: reduce(lambda x, y: x+y, seq, 0)
cumprod = lambda seq: reduce(lambda x, y: x*y, seq, 1)
_basic = [None,
True, False,
-7, 0, 7, 2**31,
-2**63+1, 2**63-1,
-2.17, 0.0, 3.14,
... | 34.834081 | 76 | 0.507209 | from mpi4py import MPI
import mpiunittest as unittest
from functools import reduce
cumsum = lambda seq: reduce(lambda x, y: x+y, seq, 0)
cumprod = lambda seq: reduce(lambda x, y: x*y, seq, 1)
_basic = [None,
True, False,
-7, 0, 7, 2**31,
-2**63+1, 2**63-1,
-2.17, 0.0, 3.14,
... | true | true |
1c099212452f08a114a85cb96f6e953436bfec6a | 16 | py | Python | utils/__init__.py | lpetre-ulb/vfatqc-python-scripts | 1f11c736de630deba24c7da927eeb9746206db93 | [
"MIT"
] | 1 | 2017-07-10T12:48:27.000Z | 2017-07-10T12:48:27.000Z | utils/__init__.py | lpetre-ulb/vfatqc-python-scripts | 1f11c736de630deba24c7da927eeb9746206db93 | [
"MIT"
] | 200 | 2016-11-11T16:13:22.000Z | 2020-05-27T13:41:39.000Z | utils/__init__.py | lpetre-ulb/vfatqc-python-scripts | 1f11c736de630deba24c7da927eeb9746206db93 | [
"MIT"
] | 20 | 2016-09-14T12:41:46.000Z | 2020-02-10T19:46:04.000Z | name = "vfatqc"
| 8 | 15 | 0.625 | name = "vfatqc"
| true | true |
1c09928e237e2110c4b3f88dca8774c314f42352 | 7,330 | py | Python | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/8-extending_bound_15.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/8-extending_bound_15.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints/scaling_ltl_infinite_state/8-extending_bound_15.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... | 36.467662 | 89 | 0.629195 | from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... | true | true |
1c09929ba4949404c60f7be5c10ba5f7dc5e4628 | 14,345 | py | Python | dlms_cosem/protocol/acse/aarq.py | Layty/dlms-cosem | 95b67054a1dfb928e960547b0246b7b6794f0594 | [
"MIT"
] | 1 | 2021-08-20T09:19:07.000Z | 2021-08-20T09:19:07.000Z | dlms_cosem/protocol/acse/aarq.py | Layty/dlms-cosem | 95b67054a1dfb928e960547b0246b7b6794f0594 | [
"MIT"
] | null | null | null | dlms_cosem/protocol/acse/aarq.py | Layty/dlms-cosem | 95b67054a1dfb928e960547b0246b7b6794f0594 | [
"MIT"
] | null | null | null | from typing import *
import attr
from dlms_cosem import enumerations
from dlms_cosem.ber import BER
from dlms_cosem.protocol import xdlms
from dlms_cosem.protocol.acse import base as acse_base
from dlms_cosem.protocol.acse.user_information import UserInformation
def user_information_holds_initiate_request(
inst... | 41.700581 | 105 | 0.684001 | from typing import *
import attr
from dlms_cosem import enumerations
from dlms_cosem.ber import BER
from dlms_cosem.protocol import xdlms
from dlms_cosem.protocol.acse import base as acse_base
from dlms_cosem.protocol.acse.user_information import UserInformation
def user_information_holds_initiate_request(
inst... | true | true |
1c0992f839ade63c1bd85aa3c6bee4a1b24884a4 | 11,043 | py | Python | src/mob/trait.py | cfmcdonald-78/Hexcrawler | 79ca4ab9327abf08de1743612c23eb89aa53a2b9 | [
"MIT"
] | null | null | null | src/mob/trait.py | cfmcdonald-78/Hexcrawler | 79ca4ab9327abf08de1743612c23eb89aa53a2b9 | [
"MIT"
] | null | null | null | src/mob/trait.py | cfmcdonald-78/Hexcrawler | 79ca4ab9327abf08de1743612c23eb89aa53a2b9 | [
"MIT"
] | 1 | 2021-12-01T01:38:12.000Z | 2021-12-01T01:38:12.000Z | '''
Created on Nov 1, 2012
@author: Chris
'''
#traits:
AQUATIC = "Aquatic" # boolean : can only move in oceans
ARMY_ATTACK = "Army attack" # boolean : attacks (ranged and normal) can affect army units
ARMY_FLIGHT = "Army flight" # boolean : as flight, but can carry rest of group
ASSASSIN = "Assa... | 56.055838 | 168 | 0.677805 |
AQUATIC = "Aquatic" ARMY_ATTACK = "Army attack" ARMY_FLIGHT = "Army flight" ASSASSIN = "Assassin" AVARICE = "Avarice" BLACK_MANA = "Black mana"
BLEND = "Blend"
BLOODTHIRST = "Bloodthirst"
BLOOD_POWER = "Blood power"
BUILD= "Build" BURN= "Burn" ... | true | true |
1c0993920ca422cab0885e2eea7af0e73703fe84 | 33,686 | py | Python | Bio/File.py | fredricj/biopython | 922063e5fec0b3c0c975f030b36eeea962e51091 | [
"BSD-3-Clause"
] | null | null | null | Bio/File.py | fredricj/biopython | 922063e5fec0b3c0c975f030b36eeea962e51091 | [
"BSD-3-Clause"
] | null | null | null | Bio/File.py | fredricj/biopython | 922063e5fec0b3c0c975f030b36eeea962e51091 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 1999 by Jeffrey Chang. All rights reserved.
# Copyright 2009-2018 by Peter Cock. All rights reserved.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been inc... | 39.169767 | 99 | 0.589592 |
import codecs
import os
import sys
import contextlib
import itertools
import platform
try:
from collections import UserDict as _dict_base
except ImportError:
from UserDict import DictMixin as _dict_base
if (sys.version_info >= (3, 7)
or platform.python_implementation() == "PyPy"
or (sys.vers... | true | true |
1c0993cc578725f5bd67fb36256a9c66403eed33 | 6,232 | py | Python | api/src/opentrons/types.py | ferlzc/opentrons | 29fac8ae6e456439f87fce60e8c935c2a2aaa582 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/types.py | ferlzc/opentrons | 29fac8ae6e456439f87fce60e8c935c2a2aaa582 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/types.py | ferlzc/opentrons | 29fac8ae6e456439f87fce60e8c935c2a2aaa582 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import enum
from math import sqrt, isclose
from typing import Any, NamedTuple, TYPE_CHECKING, Union
from opentrons.protocols.api_support.labware_like import LabwareLike
if TYPE_CHECKING:
from typing import (Optional, # noqa(F401) Used for typechecking
... | 31.004975 | 89 | 0.620988 | from __future__ import annotations
import enum
from math import sqrt, isclose
from typing import Any, NamedTuple, TYPE_CHECKING, Union
from opentrons.protocols.api_support.labware_like import LabwareLike
if TYPE_CHECKING:
from typing import (Optional, Tuple)
from .protocol_api.la... | true | true |
1c099438fdd4c5d74559900867b338a6fdbf3b11 | 118 | py | Python | venv/lib/python3.6/site-packages/pylint/test/regrtest_data/no_stdout_encoding.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/pylint/test/regrtest_data/no_stdout_encoding.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | 1 | 2021-06-01T23:32:38.000Z | 2021-06-01T23:32:38.000Z | venv/lib/python3.6/site-packages/pylint/test/regrtest_data/no_stdout_encoding.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | # -*- coding:iso-8859-1 -*-
class test:
def __init__(self, dir):
testString = u"répertoire :\n%s !" % dir
| 23.6 | 48 | 0.567797 | class test:
def __init__(self, dir):
testString = u"répertoire :\n%s !" % dir
| true | true |
1c09948579ca13249c473583fbe8dca461375c72 | 11,938 | py | Python | examples/simple_parser/parser.py | CodeForPhilly/ujs-docket-parsing | 36c402a6fc8f7c2d5cc9b87cf4790d9cb3dc703e | [
"MIT"
] | null | null | null | examples/simple_parser/parser.py | CodeForPhilly/ujs-docket-parsing | 36c402a6fc8f7c2d5cc9b87cf4790d9cb3dc703e | [
"MIT"
] | null | null | null | examples/simple_parser/parser.py | CodeForPhilly/ujs-docket-parsing | 36c402a6fc8f7c2d5cc9b87cf4790d9cb3dc703e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import argparse
import logging
from datetime import date
import json
from parsimonious.exceptions import ParseError
from parsimonious.grammar import Grammar
from parsimonious.nodes import Node, NodeVisitor
from pathlib import Path
import pdftotext
import sys
logger = logging.Logger(__name__)... | 28.491647 | 87 | 0.602865 |
import argparse
import logging
from datetime import date
import json
from parsimonious.exceptions import ParseError
from parsimonious.grammar import Grammar
from parsimonious.nodes import Node, NodeVisitor
from pathlib import Path
import pdftotext
import sys
logger = logging.Logger(__name__)
docket_decoder = Gramm... | true | true |
1c09949598ab39e469dbe3aa048cd6840ad1cf9b | 8,749 | py | Python | tensorflow/python/kernel_tests/parameterized_truncated_normal_op_test.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 101 | 2016-12-03T11:40:52.000Z | 2017-12-23T02:02:03.000Z | tensorflow/python/kernel_tests/parameterized_truncated_normal_op_test.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 9 | 2016-12-14T03:27:46.000Z | 2017-09-13T02:29:07.000Z | tensorflow/python/kernel_tests/parameterized_truncated_normal_op_test.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 47 | 2016-12-04T12:37:24.000Z | 2018-01-14T18:13:07.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.760504 | 80 | 0.656304 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import math
import timeit
import numpy as np
from six.moves import range import tensorflow as tf
from tensorflow.python.ops import random_ops
class TruncatedNormalMoments(object):
memoiz... | true | true |
1c0994ced191c7764ae922fac26fa3e7ff21dbc4 | 9,160 | py | Python | src/python/nnfusion/executor.py | heheda12345/nnfusion | 8cf153c1adae094fa891021bd6da70aeeee112ba | [
"MIT"
] | null | null | null | src/python/nnfusion/executor.py | heheda12345/nnfusion | 8cf153c1adae094fa891021bd6da70aeeee112ba | [
"MIT"
] | null | null | null | src/python/nnfusion/executor.py | heheda12345/nnfusion | 8cf153c1adae094fa891021bd6da70aeeee112ba | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
import platform
import json
import ctypes
from . import dtypes
from .utils import cd
from .description import IODescription
def find_nnf_rt(nnf_rt_dir):
def is_nnf_rt(file_name):
if platform.system().lower() == "linux":
... | 41.261261 | 208 | 0.568122 |
import os
import platform
import json
import ctypes
from . import dtypes
from .utils import cd
from .description import IODescription
def find_nnf_rt(nnf_rt_dir):
def is_nnf_rt(file_name):
if platform.system().lower() == "linux":
return file_name.startswith("libnnf") and file_name.endswith(
... | true | true |
1c0994f61423ca0f43a923170a867f08704e7dbb | 7,724 | py | Python | amy/extrequests/tests/test_event_requests.py | mattipt/amy | c8c7212fd51d875d22c413781d28e94837a3db2e | [
"MIT"
] | null | null | null | amy/extrequests/tests/test_event_requests.py | mattipt/amy | c8c7212fd51d875d22c413781d28e94837a3db2e | [
"MIT"
] | 1 | 2019-12-13T11:22:47.000Z | 2019-12-13T11:22:47.000Z | amy/extrequests/tests/test_event_requests.py | mattipt/amy | c8c7212fd51d875d22c413781d28e94837a3db2e | [
"MIT"
] | null | null | null | from django.urls import reverse
from extforms.deprecated_forms import SWCEventRequestForm, DCEventRequestForm
from extrequests.models import (
EventRequest,
)
from workshops.models import Event, Organization
from workshops.tests.base import TestBase
class TestSWCEventRequestForm(TestBase):
def setUp(self):
... | 41.304813 | 78 | 0.617556 | from django.urls import reverse
from extforms.deprecated_forms import SWCEventRequestForm, DCEventRequestForm
from extrequests.models import (
EventRequest,
)
from workshops.models import Event, Organization
from workshops.tests.base import TestBase
class TestSWCEventRequestForm(TestBase):
def setUp(self):
... | true | true |
1c09955cbc46b30751a09010ab4331110aa07b14 | 5,580 | py | Python | dndme/commands/combatant_details.py | grueproof/dndme | 4483819aedfcab532ed01a9367416173b95526b1 | [
"MIT"
] | null | null | null | dndme/commands/combatant_details.py | grueproof/dndme | 4483819aedfcab532ed01a9367416173b95526b1 | [
"MIT"
] | null | null | null | dndme/commands/combatant_details.py | grueproof/dndme | 4483819aedfcab532ed01a9367416173b95526b1 | [
"MIT"
] | null | null | null | from math import inf
from prompt_toolkit import print_formatted_text, HTML
from prompt_toolkit.styles import Style
from dndme.commands import Command
class CombatantDetails(Command):
keywords = ["details"]
help_text = """{keyword}
{divider}
Summary: Get details about a combatant--whether a character or a mon... | 35.09434 | 89 | 0.427419 | from math import inf
from prompt_toolkit import print_formatted_text, HTML
from prompt_toolkit.styles import Style
from dndme.commands import Command
class CombatantDetails(Command):
keywords = ["details"]
help_text = """{keyword}
{divider}
Summary: Get details about a combatant--whether a character or a mon... | true | true |
1c0996ea04402aa6dee1ba2204f949b89b4581ad | 1,608 | py | Python | tools/yaml_to_md.py | technopreneurG/lexicon | d391f9d678d20b8ebe77a80ac1dcf9306d23c329 | [
"Unlicense"
] | 2 | 2020-02-19T02:48:57.000Z | 2020-03-20T11:35:50.000Z | tools/yaml_to_md.py | technopreneurG/lexicon | d391f9d678d20b8ebe77a80ac1dcf9306d23c329 | [
"Unlicense"
] | 1 | 2020-04-18T00:50:27.000Z | 2020-04-18T00:50:27.000Z | tools/yaml_to_md.py | technopreneurG/lexicon | d391f9d678d20b8ebe77a80ac1dcf9306d23c329 | [
"Unlicense"
] | null | null | null | import sys
from utils.feed import *
from jinja2 import Environment, FileSystemLoader
import argparse
import yaml
import os.path
parser = argparse.ArgumentParser()
# Usage: yaml_to_md.py -d data-dir -o output -m true/false -t readme/mkdocs
# data-dir: is where the yaml files with lexicons are placed
# output-file: t... | 30.923077 | 143 | 0.741294 | import sys
from utils.feed import *
from jinja2 import Environment, FileSystemLoader
import argparse
import yaml
import os.path
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--data_dir", help="process the yaml files from data dir", required=True)
parser.add_argument("-o", "--output", help="output fil... | true | true |
1c0997f3f377a36669663253094ef0c2c78f9452 | 1,427 | py | Python | statsmodels/emplike/tests/test_origin.py | yarikoptic/statsmodels | f990cb1a1ef0c9883c9394444e6f9d027efabec6 | [
"BSD-3-Clause"
] | 1 | 2021-11-04T04:57:15.000Z | 2021-11-04T04:57:15.000Z | statsmodels/emplike/tests/test_origin.py | yarikoptic/statsmodels | f990cb1a1ef0c9883c9394444e6f9d027efabec6 | [
"BSD-3-Clause"
] | null | null | null | statsmodels/emplike/tests/test_origin.py | yarikoptic/statsmodels | f990cb1a1ef0c9883c9394444e6f9d027efabec6 | [
"BSD-3-Clause"
] | 2 | 2018-05-22T11:32:30.000Z | 2018-11-17T13:58:01.000Z | from __future__ import division
from numpy.testing import assert_almost_equal
from statsmodels.emplike.originregress import ELOriginRegress
from statsmodels.datasets import cancer
from .results.el_results import OriginResults
import numpy as np
class GenRes(object):
"""
Loads data and creates class instance o... | 31.711111 | 83 | 0.673441 | from __future__ import division
from numpy.testing import assert_almost_equal
from statsmodels.emplike.originregress import ELOriginRegress
from statsmodels.datasets import cancer
from .results.el_results import OriginResults
import numpy as np
class GenRes(object):
def __init__(self):
data = cancer.load(... | true | true |
1c09982da1ac5455097e169255b75293cd51078d | 998 | py | Python | tests/test_atmostk.py | DavidFerrerBeltran/pysat | 1c1dd0aebe077ca72ca743af4283a46bccf88bf9 | [
"MIT"
] | 267 | 2018-05-03T11:52:29.000Z | 2022-03-24T15:04:01.000Z | tests/test_atmostk.py | DavidFerrerBeltran/pysat | 1c1dd0aebe077ca72ca743af4283a46bccf88bf9 | [
"MIT"
] | 98 | 2018-08-24T17:28:41.000Z | 2022-03-24T11:38:13.000Z | tests/test_atmostk.py | DavidFerrerBeltran/pysat | 1c1dd0aebe077ca72ca743af4283a46bccf88bf9 | [
"MIT"
] | 57 | 2018-06-15T16:59:02.000Z | 2022-03-24T22:43:43.000Z | import math
from pysat.formula import IDPool
from pysat.card import CardEnc, EncType
from pysat.solvers import MinisatGH
encs = ['seqcounter', 'sortnetwrk', 'cardnetwrk', 'totalizer', 'mtotalizer',
'kmtotalizer']
def bincoeff(n, k):
n_fac = math.factorial(n)
k_fac = math.factorial(k)
n_minus_k_fa... | 34.413793 | 147 | 0.596192 | import math
from pysat.formula import IDPool
from pysat.card import CardEnc, EncType
from pysat.solvers import MinisatGH
encs = ['seqcounter', 'sortnetwrk', 'cardnetwrk', 'totalizer', 'mtotalizer',
'kmtotalizer']
def bincoeff(n, k):
n_fac = math.factorial(n)
k_fac = math.factorial(k)
n_minus_k_fa... | true | true |
1c0999169ff4655e56766c31a969eb908e5d1876 | 6,563 | py | Python | tests/run_test.py | irap-omp/deconv3d | 0ab5322f99e28a19ce5540d9a27dcbe340542d0a | [
"MIT"
] | 3 | 2016-09-19T08:52:37.000Z | 2018-12-07T09:33:20.000Z | tests/run_test.py | irap-omp/deconv3d | 0ab5322f99e28a19ce5540d9a27dcbe340542d0a | [
"MIT"
] | 1 | 2015-04-09T12:30:14.000Z | 2015-04-09T14:05:30.000Z | tests/run_test.py | irap-omp/deconv3d | 0ab5322f99e28a19ce5540d9a27dcbe340542d0a | [
"MIT"
] | 3 | 2017-12-13T14:26:24.000Z | 2019-07-26T18:15:37.000Z |
# GENERAL PACKAGES ############################################################
from os import pardir, remove
from os.path import abspath, dirname, join, isfile
import numpy as np
import unittest
from hyperspectral import HyperspectralCube as Cube
# LOCAL PACKAGES #####################################################... | 34.361257 | 148 | 0.595459 |
from os import pardir, remove
from os.path import abspath, dirname, join, isfile
import numpy as np
import unittest
from hyperspectral import HyperspectralCube as Cube
import sys
sys.path.append('.')
from lib.run import Run
from lib.instruments import MUSE
from lib.line_models import SingleGaussianLineModel
from li... | true | true |
1c0999462c199d75f00a45ac8d249ff0e2a5e081 | 17,320 | py | Python | flexget/components/parsing/parsers/parser_guessit.py | vxcamiloxv/Flexget | f18e53b59b768515d8e67464b8cc41bddfc00c33 | [
"MIT"
] | null | null | null | flexget/components/parsing/parsers/parser_guessit.py | vxcamiloxv/Flexget | f18e53b59b768515d8e67464b8cc41bddfc00c33 | [
"MIT"
] | null | null | null | flexget/components/parsing/parsers/parser_guessit.py | vxcamiloxv/Flexget | f18e53b59b768515d8e67464b8cc41bddfc00c33 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, unicode_literals
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.utils import native
import logging
import re
import sys
import time
from guessit.api import GuessItApi, GuessitException
from guessit.rules import rebulk_build... | 40.46729 | 118 | 0.585566 | from __future__ import absolute_import, division, unicode_literals
from builtins import * from future.utils import native
import logging
import re
import sys
import time
from guessit.api import GuessItApi, GuessitException
from guessit.rules import rebulk_builder
from rebulk import Rebulk
from rebulk.match import Ma... | true | true |
1c099a1341875ced12256932b0dbea8ca42af9de | 415 | py | Python | baselines/deepq/__init__.py | wyz2368/baselines_nogym | 29f54f73e495e79d06a1311200d8431e6a7c7f3b | [
"MIT"
] | null | null | null | baselines/deepq/__init__.py | wyz2368/baselines_nogym | 29f54f73e495e79d06a1311200d8431e6a7c7f3b | [
"MIT"
] | null | null | null | baselines/deepq/__init__.py | wyz2368/baselines_nogym | 29f54f73e495e79d06a1311200d8431e6a7c7f3b | [
"MIT"
] | null | null | null | from baselines.deepq import models # noqa
from baselines.deepq.build_graph import build_act, build_train # noqa
from baselines.deepq.deepq import learn, load_act # noqa
from baselines.deepq.replay_buffer import ReplayBuffer, PrioritizedReplayBuffer # noqa
# def wrap_atari_dqn(env):
# from baselines.common.atar... | 46.111111 | 87 | 0.804819 | from baselines.deepq import models from baselines.deepq.build_graph import build_act, build_train from baselines.deepq.deepq import learn, load_act from baselines.deepq.replay_buffer import ReplayBuffer, PrioritizedReplayBuffer
| true | true |
1c099b80812f4049976aae44da9fc6ead9bb97a7 | 4,243 | py | Python | biothings/utils/web/es_transport.py | dongbohu/biothings.api | 9af8742566e1d77a361b9a2fa3595fa24ca81932 | [
"Apache-2.0"
] | null | null | null | biothings/utils/web/es_transport.py | dongbohu/biothings.api | 9af8742566e1d77a361b9a2fa3595fa24ca81932 | [
"Apache-2.0"
] | null | null | null | biothings/utils/web/es_transport.py | dongbohu/biothings.api | 9af8742566e1d77a361b9a2fa3595fa24ca81932 | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
import aiohttp
from elasticsearch.transport import Transport, TransportError
from elasticsearch_async.transport import AsyncTransport
from .es_connection import BiothingsAIOHttpConnection
logger = logging.getLogger(__package__)
class BiothingsAsyncTransport(AsyncTransport):
"""
... | 33.409449 | 91 | 0.597455 | import asyncio
import logging
import aiohttp
from elasticsearch.transport import Transport, TransportError
from elasticsearch_async.transport import AsyncTransport
from .es_connection import BiothingsAIOHttpConnection
logger = logging.getLogger(__package__)
class BiothingsAsyncTransport(AsyncTransport):
def __... | true | true |
1c099bbbe5a6fba801152f6b733fa21f613dccbe | 31,237 | py | Python | archive/_metrics_OLD2.py | johnh865/election_sim | b73b7e65f1bb22abb82cbe8442fcf02b0c20894e | [
"MIT"
] | 8 | 2019-10-21T23:24:51.000Z | 2021-09-14T03:04:59.000Z | archive/_metrics_OLD2.py | johnh865/election_sim | b73b7e65f1bb22abb82cbe8442fcf02b0c20894e | [
"MIT"
] | 2 | 2021-02-09T23:52:47.000Z | 2021-02-10T04:08:35.000Z | archive/_metrics_OLD2.py | johnh865/election_sim | b73b7e65f1bb22abb82cbe8442fcf02b0c20894e | [
"MIT"
] | 1 | 2019-10-21T23:32:18.000Z | 2019-10-21T23:32:18.000Z | # -*- coding: utf-8 -*-
"""
Various metrics to measure performance of an election
"""
import logging
import numpy as np
import scipy
import scipy.interpolate
from scipy.interpolate import NearestNDInterpolator
from votesim import utilities
from votesim.models import vcalcs
from votesim.utilities.math import NearestM... | 30.564579 | 95 | 0.572334 | """
Various metrics to measure performance of an election
"""
import logging
import numpy as np
import scipy
import scipy.interpolate
from scipy.interpolate import NearestNDInterpolator
from votesim import utilities
from votesim.models import vcalcs
from votesim.utilities.math import NearestManhattanInterpolator
log... | false | true |
1c099c8d0c28e4aebede1fef5a712fa081780293 | 1,258 | py | Python | uploader.py | diegodelemos/client-server-flask-big-file-uploads | ef00b48004f7c5b2532c16b56d94e72d27d3be74 | [
"MIT"
] | 8 | 2020-03-16T10:02:07.000Z | 2021-11-25T09:35:47.000Z | uploader.py | diegodelemos/client-server-flask-big-file-uploads | ef00b48004f7c5b2532c16b56d94e72d27d3be74 | [
"MIT"
] | 1 | 2021-12-15T08:59:43.000Z | 2021-12-15T08:59:43.000Z | uploader.py | diegodelemos/client-server-flask-big-file-uploads | ef00b48004f7c5b2532c16b56d94e72d27d3be74 | [
"MIT"
] | 1 | 2021-08-17T09:42:56.000Z | 2021-08-17T09:42:56.000Z | import os
import click
import requests
BIG_UPLOAD_SERVER_URL = os.getenv('BIG_UPLOAD_SERVER_URL',
'http://localhost:5000/')
UPLOADER_BY_TYPE = {
'request.files': lambda file, profile: requests.post(os.path.join(
BIG_UPLOAD_SERVER_URL, 'request-files'), files={'file': fil... | 33.105263 | 71 | 0.633545 | import os
import click
import requests
BIG_UPLOAD_SERVER_URL = os.getenv('BIG_UPLOAD_SERVER_URL',
'http://localhost:5000/')
UPLOADER_BY_TYPE = {
'request.files': lambda file, profile: requests.post(os.path.join(
BIG_UPLOAD_SERVER_URL, 'request-files'), files={'file': fil... | true | true |
1c099cd66bda7e75edf507c8ee92c458083aa64b | 475 | py | Python | src/report.py | wrighting/upgrade-assist | 7d6c041998d04ea1ba7a0072d4ba15864676714c | [
"Apache-2.0"
] | 2 | 2016-10-12T15:26:06.000Z | 2017-05-08T19:29:58.000Z | src/report.py | wrighting/upgrade-assist | 7d6c041998d04ea1ba7a0072d4ba15864676714c | [
"Apache-2.0"
] | 3 | 2016-10-13T07:13:12.000Z | 2017-03-07T15:50:09.000Z | src/report.py | wrighting/upgrade-assist | 7d6c041998d04ea1ba7a0072d4ba15864676714c | [
"Apache-2.0"
] | null | null | null |
class Report(object):
def actionRequired(self, message, customFile, oldFile, newFile):
print()
print("You need to check: " + customFile)
print(message)
print("Old file:" + oldFile)
print("New file:" + newFile)
print()
def info(self, message):
print (mes... | 20.652174 | 68 | 0.555789 |
class Report(object):
def actionRequired(self, message, customFile, oldFile, newFile):
print()
print("You need to check: " + customFile)
print(message)
print("Old file:" + oldFile)
print("New file:" + newFile)
print()
def info(self, message):
print (mes... | true | true |
1c099d89b743c4e608107b0e4d4f638163a20b08 | 27,848 | py | Python | bin/storm.py | b-deng/storm | e7e9eb9492ecd7ff909037561a6e7649f2aa7dc7 | [
"Apache-2.0"
] | null | null | null | bin/storm.py | b-deng/storm | e7e9eb9492ecd7ff909037561a6e7649f2aa7dc7 | [
"Apache-2.0"
] | null | null | null | bin/storm.py | b-deng/storm | e7e9eb9492ecd7ff909037561a6e7649f2aa7dc7 | [
"Apache-2.0"
] | 1 | 2019-09-13T23:29:44.000Z | 2019-09-13T23:29:44.000Z | #!/usr/bin/python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Licen... | 36.498034 | 150 | 0.664213 |
import os
import random
import re
import shlex
import tempfile
import uuid
import subprocess as sub
import sys
try:
from urllib.parse import quote_plus
except ImportError:
from urllib import quote_plus
try:
import configparser
except ImportError:
import ConfigParser as configparser
... | false | true |
1c099d8ba2940c07cab21599b8b00d91874f3657 | 88,672 | py | Python | packages/python/plotly/plotly/graph_objs/_volume.py | benlindsay/plotly.py | 51ec6cb50d537a37da704ca74c07f11b62730110 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/_volume.py | benlindsay/plotly.py | 51ec6cb50d537a37da704ca74c07f11b62730110 | [
"MIT"
] | 1 | 2022-01-22T14:39:41.000Z | 2022-01-22T14:39:41.000Z | packages/python/plotly/plotly/graph_objs/_volume.py | RARedeem/plotly.py | 8289eb1c85125e147c4ce14b56272ed50b99ef20 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Volume(_BaseTraceType):
# class properties
# --------------------
_parent_path_str = ""
_path_str = "volume"
_valid_props = {
"autocolorscale",
"caps",
"cauto",
"cmax",
... | 35.398004 | 89 | 0.547264 | from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Volume(_BaseTraceType):
_parent_path_str = ""
_path_str = "volume"
_valid_props = {
"autocolorscale",
"caps",
"cauto",
"cmax",
"cmid",
"cmin",
"color... | true | true |
1c099d96364094b741d5deac83d843c94475ffd2 | 10,690 | py | Python | nengo/tests/test_simulator.py | HugoChateauLaurent/nengo | 749893186ee09aa6c621a40da3ffd3878114db9c | [
"BSD-2-Clause"
] | null | null | null | nengo/tests/test_simulator.py | HugoChateauLaurent/nengo | 749893186ee09aa6c621a40da3ffd3878114db9c | [
"BSD-2-Clause"
] | null | null | null | nengo/tests/test_simulator.py | HugoChateauLaurent/nengo | 749893186ee09aa6c621a40da3ffd3878114db9c | [
"BSD-2-Clause"
] | null | null | null | import pkg_resources
import numpy as np
import pytest
import nengo
import nengo.simulator
from nengo.builder import Model
from nengo.builder.ensemble import BuiltEnsemble
from nengo.builder.operator import DotInc
from nengo.builder.signal import Signal
from nengo.exceptions import ObsoleteError, SimulatorClosed, Vali... | 30.112676 | 79 | 0.621422 | import pkg_resources
import numpy as np
import pytest
import nengo
import nengo.simulator
from nengo.builder import Model
from nengo.builder.ensemble import BuiltEnsemble
from nengo.builder.operator import DotInc
from nengo.builder.signal import Signal
from nengo.exceptions import ObsoleteError, SimulatorClosed, Vali... | true | true |
1c099e1157042cc376e1f5d5765bb62552184aa4 | 35,530 | py | Python | noisemaker/value.py | aayars/py-noisemaker | 4e27f536632ade583eb0110aaaa9e19c59355ba6 | [
"Apache-2.0"
] | 106 | 2017-03-25T23:14:55.000Z | 2022-01-11T04:18:14.000Z | noisemaker/value.py | aayars/py-noisemaker | 4e27f536632ade583eb0110aaaa9e19c59355ba6 | [
"Apache-2.0"
] | 32 | 2020-06-03T05:40:06.000Z | 2022-03-31T13:00:56.000Z | noisemaker/value.py | aayars/py-noisemaker | 4e27f536632ade583eb0110aaaa9e19c59355ba6 | [
"Apache-2.0"
] | 10 | 2018-12-03T19:23:56.000Z | 2021-01-13T17:55:04.000Z | """Low-level value noise functions"""
from collections import defaultdict
import math
import random
import numpy as np
import tensorflow as tf
from noisemaker.constants import (
DistanceMetric,
InterpolationType,
PointDistribution,
ValueDistribution,
ValueMask,
VoronoiDiagramType,
)
from noi... | 33.74169 | 143 | 0.648522 |
from collections import defaultdict
import math
import random
import numpy as np
import tensorflow as tf
from noisemaker.constants import (
DistanceMetric,
InterpolationType,
PointDistribution,
ValueDistribution,
ValueMask,
VoronoiDiagramType,
)
from noisemaker.effects_registry import effect... | true | true |
1c099f478339c5e59bdcba163eab83c25fc4750c | 72 | py | Python | jacdac/led_strip/__init__.py | microsoft/jacdac-python | 712ad5559e29065f5eccb5dbfe029c039132df5a | [
"MIT"
] | 1 | 2022-02-15T21:30:36.000Z | 2022-02-15T21:30:36.000Z | jacdac/led_strip/__init__.py | microsoft/jacdac-python | 712ad5559e29065f5eccb5dbfe029c039132df5a | [
"MIT"
] | null | null | null | jacdac/led_strip/__init__.py | microsoft/jacdac-python | 712ad5559e29065f5eccb5dbfe029c039132df5a | [
"MIT"
] | 1 | 2022-02-08T19:32:45.000Z | 2022-02-08T19:32:45.000Z | # Autogenerated file.
from .client import LedStripClient # type: ignore
| 24 | 49 | 0.791667 | from .client import LedStripClient | true | true |
1c099fca291efc9de3a4fa897131148e76f53a9e | 13,093 | py | Python | h/services/oauth_validator.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | null | null | null | h/services/oauth_validator.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | 4 | 2020-03-24T17:38:24.000Z | 2022-03-02T05:45:01.000Z | h/services/oauth_validator.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import hmac
from oauthlib.oauth2 import InvalidClientIdError, RequestValidator
from sqlalchemy.exc import StatementError
from h import models
from h.models.auth_client import GrantType as AuthClientGrantType
from h.services.oauth_provid... | 36.168508 | 107 | 0.656152 |
from __future__ import unicode_literals
import datetime
import hmac
from oauthlib.oauth2 import InvalidClientIdError, RequestValidator
from sqlalchemy.exc import StatementError
from h import models
from h.models.auth_client import GrantType as AuthClientGrantType
from h.services.oauth_provider import ACCESS_TOKEN_P... | true | true |
1c09a036920718b655ab95d00a379f9c6ce0b9b7 | 3,262 | py | Python | tests/gold_tests/logging/custom-log.test.py | masaori335/trafficserver | 58e7e8675c96a5a4eb958a442942892f6e2a0ef4 | [
"Apache-2.0"
] | 1 | 2019-10-28T04:36:50.000Z | 2019-10-28T04:36:50.000Z | tests/gold_tests/logging/custom-log.test.py | masaori335/trafficserver | 58e7e8675c96a5a4eb958a442942892f6e2a0ef4 | [
"Apache-2.0"
] | 1 | 2021-06-27T23:06:33.000Z | 2021-06-27T23:06:33.000Z | tests/gold_tests/logging/custom-log.test.py | masaori335/trafficserver | 58e7e8675c96a5a4eb958a442942892f6e2a0ef4 | [
"Apache-2.0"
] | null | null | null | '''
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License");... | 31.980392 | 84 | 0.702636 |
import os
Test.Summary = '''
Test custom log file format
'''
Test.SkipUnless(
Condition.IsPlatform("linux")
)
ts = Test.MakeATSProcess("ts")
ts.Disk.remap_config.AddLine(
'map / http://www.linkedin.com/ @action=deny'
)
ts.Disk.logging_yaml.AddLines(
'''
formats:
- name: custom
format: "%<hii> %<h... | true | true |
1c09a095c26f8ed16c89b1c530cc5add0a04dc17 | 833 | py | Python | SimpleCV/examples/detection/FisherFaceRecognizer.py | tpltnt/SimpleCV | 9fd75457cce5fd111c4d251b1076b9447fa4f1a2 | [
"BSD-3-Clause"
] | 8 | 2016-12-11T20:28:03.000Z | 2022-02-11T21:15:26.000Z | SimpleCV/examples/detection/FisherFaceRecognizer.py | tpltnt/SimpleCV | 9fd75457cce5fd111c4d251b1076b9447fa4f1a2 | [
"BSD-3-Clause"
] | 19 | 2016-11-24T20:28:18.000Z | 2017-03-18T16:40:40.000Z | SimpleCV/examples/detection/FisherFaceRecognizer.py | tpltnt/SimpleCV | 9fd75457cce5fd111c4d251b1076b9447fa4f1a2 | [
"BSD-3-Clause"
] | 3 | 2016-11-27T22:29:08.000Z | 2019-12-04T00:35:32.000Z | from __future__ import print_function
from SimpleCV import *
import time
"""
This is an example of HOW-TO use FaceRecognizer to recognize gender
of the person.
"""
def identifyGender():
f = FaceRecognizer()
cam = Camera()
img = cam.getImage()
cascade = LAUNCH_PATH + "/" + "Features/HaarCascades/face.x... | 24.5 | 76 | 0.65066 | from __future__ import print_function
from SimpleCV import *
import time
def identifyGender():
f = FaceRecognizer()
cam = Camera()
img = cam.getImage()
cascade = LAUNCH_PATH + "/" + "Features/HaarCascades/face.xml"
feat = img.findHaarFeatures(cascade)
if feat:
crop_image = feat.sortAre... | true | true |
1c09a1412326740486c0bf7e98e335b008abcfb0 | 3,641 | py | Python | vendor/github.com/youtube/vitess/test/topo_flavor/etcd.py | GoLandr/NrogBT | 0dfcf87718954c730f44b8cf6c661082d47396d0 | [
"MIT"
] | 1 | 2017-06-29T04:57:43.000Z | 2017-06-29T04:57:43.000Z | vendor/github.com/youtube/vitess/test/topo_flavor/etcd.py | GoLandr/NrogBT | 0dfcf87718954c730f44b8cf6c661082d47396d0 | [
"MIT"
] | null | null | null | vendor/github.com/youtube/vitess/test/topo_flavor/etcd.py | GoLandr/NrogBT | 0dfcf87718954c730f44b8cf6c661082d47396d0 | [
"MIT"
] | 3 | 2017-04-03T21:07:17.000Z | 2020-03-04T04:59:05.000Z | #!/usr/bin/env python
# Copyright 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
"""Etcd specific configuration."""
import os
import shutil
import server
class EtcdCluster(object):
"""Sets up a global or cell-local etcd... | 32.221239 | 77 | 0.591596 |
import os
import shutil
import server
class EtcdCluster(object):
def __init__(self, name):
import environment import utils
self.port_base = environment.reserve_ports(2)
self.name = name
self.hostname = 'localhost'
self.client_port = self.port_base
self.peer_port = self.port_base... | true | true |
1c09a2b4560b6acb401b0f507e1f1b3ab0e337d1 | 2,529 | py | Python | python/tests/teleporter_test.py | xuyanbo03/lab | cf2f5250e1a00ecce37b3480df28c3a5dcd08b57 | [
"CC-BY-4.0"
] | 7,407 | 2016-12-06T08:40:58.000Z | 2022-03-31T12:19:09.000Z | python/tests/teleporter_test.py | xuyanbo03/lab | cf2f5250e1a00ecce37b3480df28c3a5dcd08b57 | [
"CC-BY-4.0"
] | 227 | 2016-12-06T22:05:33.000Z | 2022-03-29T09:47:06.000Z | python/tests/teleporter_test.py | xuyanbo03/lab | cf2f5250e1a00ecce37b3480df28c3a5dcd08b57 | [
"CC-BY-4.0"
] | 1,594 | 2016-12-06T08:44:13.000Z | 2022-03-31T12:19:12.000Z | # Copyright 2018 Google Inc.
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ho... | 32.012658 | 78 | 0.659945 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import unittest
import numpy as np
import six
import deepmind_lab
class TeleporterTest(unittest.TestCase):
def test_movement(self):
fps = 60
env = deepmind_lab.Lab(
'tests/telepo... | true | true |
1c09a3219cd37546d0d10c53f2a75ca93a370ae5 | 4,483 | py | Python | rssympim/examples/rz_profile.py | radiasoft/rssympic | 14b119267686c64e2d0fcd3be19c365b8d486e22 | [
"Apache-2.0"
] | 2 | 2017-02-07T22:04:42.000Z | 2017-04-27T13:00:03.000Z | rssympim/examples/rz_profile.py | radiasoft/rssympic | 14b119267686c64e2d0fcd3be19c365b8d486e22 | [
"Apache-2.0"
] | 14 | 2017-02-22T23:03:58.000Z | 2018-03-27T21:51:03.000Z | rssympim/examples/rz_profile.py | radiasoft/rssympic | 14b119267686c64e2d0fcd3be19c365b8d486e22 | [
"Apache-2.0"
] | null | null | null | # # A simple test of SymPIM-rz which can be used for profiling the Python bottlenecks
#
# September 26, 2017
# Nathan Cook
import numpy as np
from rssympim.sympim_rz.data import particle_data, field_data
from rssympim.sympim_rz.integrators import integrator
from rssympim.constants import constants
#from scipy.speci... | 30.917241 | 130 | 0.627928 |
import numpy as np
from rssympim.sympim_rz.data import particle_data, field_data
from rssympim.sympim_rz.integrators import integrator
from rssympim.constants import constants
charge = constants.electron_charge
mass = constants.electron_mass
speed_of_light = constants.c
n0 = 1.e18 omega_p = np.sqrt(4.*np.pi*n0*c... | true | true |
1c09a3cddda08fefc93a93f32239cc70d292272d | 1,258 | py | Python | setup.py | ledmonster/gxredis | 44f2adb97522e3c1fe5f9e96851f7d087bd8e862 | [
"MIT"
] | 4 | 2017-10-22T12:24:35.000Z | 2020-12-18T02:19:51.000Z | setup.py | groove-x/gxredis | 44f2adb97522e3c1fe5f9e96851f7d087bd8e862 | [
"MIT"
] | null | null | null | setup.py | groove-x/gxredis | 44f2adb97522e3c1fe5f9e96851f7d087bd8e862 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
version = '0.3.2'
try:
with open('README.rst') as f:
readme = f.read()
except IOError:
readme = ''
setup(
name="gxredis",
version=version,
description="Simple redis-py wrapper library",
long_description=readme,
url="https://github.com/gr... | 29.952381 | 50 | 0.612083 | from setuptools import setup, find_packages
version = '0.3.2'
try:
with open('README.rst') as f:
readme = f.read()
except IOError:
readme = ''
setup(
name="gxredis",
version=version,
description="Simple redis-py wrapper library",
long_description=readme,
url="https://github.com/gr... | true | true |
1c09a43e8f0bdf44d9a71240d65b88050b83a927 | 2,350 | py | Python | docs/conf.py | kuma35/pyusb-docs-ja | 40ce15566549ea797c92d252b4593f83ad19376a | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | kuma35/pyusb-docs-ja | 40ce15566549ea797c92d252b4593f83ad19376a | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | kuma35/pyusb-docs-ja | 40ce15566549ea797c92d252b4593f83ad19376a | [
"BSD-3-Clause"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 31.756757 | 79 | 0.673617 |
project = 'pyusb'
copyright = '2021, pyusb'
author = 'pyusb'
release = '1.0'
extensions = [
"sphinx_rtd_theme",
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store' , 'internal', ]
html_theme = "sphinx_rtd_theme"
html_static_path = ['_static']
locale_dirs = ['loca... | true | true |
1c09a484e43b5ff257ba55834e3b54214300b06a | 599 | py | Python | toph/menu/menu.py | borosilva/Toph-OSINT | 0aa49ffa405dee5ef0b358a041734cc15ca54523 | [
"MIT"
] | null | null | null | toph/menu/menu.py | borosilva/Toph-OSINT | 0aa49ffa405dee5ef0b358a041734cc15ca54523 | [
"MIT"
] | null | null | null | toph/menu/menu.py | borosilva/Toph-OSINT | 0aa49ffa405dee5ef0b358a041734cc15ca54523 | [
"MIT"
] | null | null | null | from toph.common import exceptions
from toph.config.menu import menuOptions
from toph.target import target
from simple_term_menu import TerminalMenu
def printMenu():
try:
menuOptionsConfig = menuOptions.optionsMenu
menuOptionsTermnial = TerminalMenu(menuOptionsConfig, title="Select one option:")
selectionIndex... | 26.043478 | 83 | 0.811352 | from toph.common import exceptions
from toph.config.menu import menuOptions
from toph.target import target
from simple_term_menu import TerminalMenu
def printMenu():
try:
menuOptionsConfig = menuOptions.optionsMenu
menuOptionsTermnial = TerminalMenu(menuOptionsConfig, title="Select one option:")
selectionIndex... | true | true |
1c09a51db7fdec7e6d6eddf8de67f48edf289f31 | 25 | py | Python | baopig/ressources/__init__.py | ChreSyr/baopig | 6264ab9a851b1ed0a031292abe7f159a53b3fc5e | [
"MIT"
] | null | null | null | baopig/ressources/__init__.py | ChreSyr/baopig | 6264ab9a851b1ed0a031292abe7f159a53b3fc5e | [
"MIT"
] | null | null | null | baopig/ressources/__init__.py | ChreSyr/baopig | 6264ab9a851b1ed0a031292abe7f159a53b3fc5e | [
"MIT"
] | null | null | null | from .ressources import * | 25 | 25 | 0.8 | from .ressources import * | true | true |
1c09a5626c1ab11c21c82f0838836d40f824861f | 1,285 | py | Python | src/sensors/sensors9_bigvalue.py | KbYll/tipboard | e6a33e6970b64ecff7872ae3d9fe63129ccaa854 | [
"Apache-2.0"
] | 21 | 2020-02-03T14:13:07.000Z | 2022-03-23T18:04:38.000Z | src/sensors/sensors9_bigvalue.py | KbYll/tipboard | e6a33e6970b64ecff7872ae3d9fe63129ccaa854 | [
"Apache-2.0"
] | 64 | 2019-09-30T19:59:45.000Z | 2020-05-28T11:25:09.000Z | src/sensors/sensors9_bigvalue.py | KbYll/tipboard | e6a33e6970b64ecff7872ae3d9fe63129ccaa854 | [
"Apache-2.0"
] | 7 | 2019-10-22T19:06:00.000Z | 2020-10-30T22:43:25.000Z | import time, random
from src.sensors.utils import end, sendUpdateByApi
from src.tipboard.app.properties import BACKGROUND_TAB
def executeScriptToGetData():
""" Simulate some actions for text tile exemple """
ulv = random.randrange(42, 420)
llv = random.randrange(42, 420)
urv = random.randrange(42, 420... | 38.939394 | 119 | 0.66537 | import time, random
from src.sensors.utils import end, sendUpdateByApi
from src.tipboard.app.properties import BACKGROUND_TAB
def executeScriptToGetData():
ulv = random.randrange(42, 420)
llv = random.randrange(42, 420)
urv = random.randrange(42, 420)
lrv = ulv + llv + urv
return {
'title'... | true | true |
1c09a5c813ae8ceec81ff8ded1b9f718b9e9db99 | 279 | py | Python | py/codeforces/854B.py | shhuan/algorithms | 2830c7e2ada8dfd3dcdda7c06846116d4f944a27 | [
"MIT"
] | null | null | null | py/codeforces/854B.py | shhuan/algorithms | 2830c7e2ada8dfd3dcdda7c06846116d4f944a27 | [
"MIT"
] | null | null | null | py/codeforces/854B.py | shhuan/algorithms | 2830c7e2ada8dfd3dcdda7c06846116d4f944a27 | [
"MIT"
] | 1 | 2022-03-09T04:52:55.000Z | 2022-03-09T04:52:55.000Z | # -*- coding: utf-8 -*-
import math
import collections
import bisect
import heapq
import time
import random
import itertools
"""
created by shhuan at 2017/10/19 13:10
"""
N, K = map(int, input().split())
if K == N or K == 0:
print(0, 0)
else:
print(1, min(N-K, K*2)) | 13.285714 | 37 | 0.630824 |
import math
import collections
import bisect
import heapq
import time
import random
import itertools
N, K = map(int, input().split())
if K == N or K == 0:
print(0, 0)
else:
print(1, min(N-K, K*2)) | true | true |
1c09a7b8267f68dfdee73ac8cba671829e0a8c92 | 4,600 | py | Python | tests/python/unittest/test_codegen_c_host.py | ptrendx/tvm | f07fe80aaf110086b651f2850506c803a5688ddb | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_codegen_c_host.py | ptrendx/tvm | f07fe80aaf110086b651f2850506c803a5688ddb | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_codegen_c_host.py | ptrendx/tvm | f07fe80aaf110086b651f2850506c803a5688ddb | [
"Apache-2.0"
] | 1 | 2019-12-03T13:53:44.000Z | 2019-12-03T13:53:44.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.9375 | 104 | 0.601957 | import tvm
import numpy as np
from tvm.contrib import util
def test_add():
nn = 1024
n = tvm.convert(nn)
A = tvm.placeholder((n,), name='A')
B = tvm.placeholder((n,), name='B')
C = tvm.compute(A.shape, lambda *i: A(*i) + B(*i), name='C')
s = tvm.create_schedule(C.op)
def check_c():
... | true | true |
1c09a8f4952bff7c8279aa47df4f89041b7c3d32 | 693 | py | Python | src/utils/builders.py | Galsor/KBNPathfinder | 74a5538a242193368d4d08dc064ea63d0ba4792c | [
"MIT"
] | null | null | null | src/utils/builders.py | Galsor/KBNPathfinder | 74a5538a242193368d4d08dc064ea63d0ba4792c | [
"MIT"
] | null | null | null | src/utils/builders.py | Galsor/KBNPathfinder | 74a5538a242193368d4d08dc064ea63d0ba4792c | [
"MIT"
] | null | null | null | from typing import List, Optional
import pandas as pd
from src.structures.node import Node
def build_nodes_from_pandas(
df: pd.DataFrame,
score_col: str,
x_col: str,
y_col: str,
id_col: Optional[str] = None,
properties_cols: List[str] = [],
) -> List[Node]:
nodes = []
for i, row in d... | 23.1 | 59 | 0.551227 | from typing import List, Optional
import pandas as pd
from src.structures.node import Node
def build_nodes_from_pandas(
df: pd.DataFrame,
score_col: str,
x_col: str,
y_col: str,
id_col: Optional[str] = None,
properties_cols: List[str] = [],
) -> List[Node]:
nodes = []
for i, row in d... | true | true |
1c09aa0b864127de03074fc411a6e728b4ad10a3 | 28,590 | py | Python | pysynphot/observation.py | dobos/pysynphot | 5d2e0b52ceda78890940ac9239c2d88e149e0bed | [
"BSD-3-Clause"
] | null | null | null | pysynphot/observation.py | dobos/pysynphot | 5d2e0b52ceda78890940ac9239c2d88e149e0bed | [
"BSD-3-Clause"
] | null | null | null | pysynphot/observation.py | dobos/pysynphot | 5d2e0b52ceda78890940ac9239c2d88e149e0bed | [
"BSD-3-Clause"
] | null | null | null | # It defines a new Observation class, subclassed from CompositeSourceSpectrum,
# that has some special methods and attributes and explicitly removes
# certain other methods.
"""This module handles an observation and related calculations."""
from __future__ import division
import logging
import numpy as np
import math
... | 33.052023 | 176 | 0.575411 | from __future__ import division
import logging
import numpy as np
import math
from . import spectrum
from . import units
from . import binning
from . import exceptions
from .obsbandpass import pixel_range, wave_range
from .spectrum import ArraySourceSpectrum
try:
import pysynphot_utils
utils_imported = Tru... | true | true |
1c09aa897784dba7f82ffdedb5de94016c993f4c | 1,091 | py | Python | setup.py | newsdev/nyt-clerk | 2c09c8be80bb6ff034f54e44b085e4248b7531ea | [
"Apache-2.0"
] | 40 | 2015-08-25T15:01:03.000Z | 2020-11-14T09:18:38.000Z | setup.py | lennybronner/nyt-clerk | 2c09c8be80bb6ff034f54e44b085e4248b7531ea | [
"Apache-2.0"
] | 13 | 2015-08-26T19:24:06.000Z | 2017-02-01T03:32:00.000Z | setup.py | newsdev/nyt-clerk | 2c09c8be80bb6ff034f54e44b085e4248b7531ea | [
"Apache-2.0"
] | 4 | 2015-08-26T04:40:49.000Z | 2019-06-20T14:16:49.000Z | import os.path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
setup(
name='nyt-clerk',
version='0.1.21',
author='Jeremy Bowers',
author_email='jeremy.bowers@... | 31.171429 | 130 | 0.63978 | import os.path
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
setup(
name='nyt-clerk',
version='0.1.21',
author='Jeremy Bowers',
author_email='jeremy.bowers@... | true | true |
1c09aa976810fc3a3bda0b6a810e8ca818deb8c7 | 420 | py | Python | src/links/ergo_task_detail.py | headout/ergo-airflow | 6fbdeea1e8bb1ac87bf635be10c7a770cbf3884c | [
"MIT"
] | null | null | null | src/links/ergo_task_detail.py | headout/ergo-airflow | 6fbdeea1e8bb1ac87bf635be10c7a770cbf3884c | [
"MIT"
] | null | null | null | src/links/ergo_task_detail.py | headout/ergo-airflow | 6fbdeea1e8bb1ac87bf635be10c7a770cbf3884c | [
"MIT"
] | 1 | 2020-09-26T20:26:02.000Z | 2020-09-26T20:26:02.000Z | from airflow.models.baseoperator import BaseOperatorLink
from flask import url_for
class ErgoTaskDetailLink(BaseOperatorLink):
"""
Shows details of Ergo Task
"""
name = 'Ergo'
def get_link(self, operator, dttm):
return url_for(
'ErgoView.task_detail',
ti_task_id=op... | 23.333333 | 56 | 0.642857 | from airflow.models.baseoperator import BaseOperatorLink
from flask import url_for
class ErgoTaskDetailLink(BaseOperatorLink):
name = 'Ergo'
def get_link(self, operator, dttm):
return url_for(
'ErgoView.task_detail',
ti_task_id=operator.task_id,
ti_dag_id=operator.... | true | true |
1c09aab3046dd8b5f2eef40cbc7c0e002d69c3d6 | 2,856 | py | Python | src/com/designingnn/resources/cifar10_hyper_parameters.py | kbeathanabhotla/designing-neural-networks | 8c85be6efe9ff2676624d64720ecc9c18abab14d | [
"MIT"
] | 1 | 2022-03-13T14:38:12.000Z | 2022-03-13T14:38:12.000Z | src/com/designingnn/resources/cifar10_hyper_parameters.py | kbeathanabhotla/designing-neural-networks | 8c85be6efe9ff2676624d64720ecc9c18abab14d | [
"MIT"
] | null | null | null | src/com/designingnn/resources/cifar10_hyper_parameters.py | kbeathanabhotla/designing-neural-networks | 8c85be6efe9ff2676624d64720ecc9c18abab14d | [
"MIT"
] | null | null | null | MODEL_NAME = 'cifar10'
# Number of output neurons
NUM_CLASSES = 10 # Number of output neurons
#Final Image Size
IMAGE_HEIGHT = 32 # Final Image Height NOTE: code only supports square im... | 75.157895 | 222 | 0.465336 | MODEL_NAME = 'cifar10'
NUM_CLASSES = 10
IMAGE_HEIGHT = 32 IMAGE_WIDTH = 32
TRAIN_BATCH_SIZE = 150 ... | true | true |
1c09aabb25eb3d8d03eb9a46926083e28018a85a | 155 | py | Python | src/utils/common.py | DhyeySherasia/ANN-implementation | f69f9590edfa020ac42c53d187967f2848f3e8d7 | [
"MIT"
] | null | null | null | src/utils/common.py | DhyeySherasia/ANN-implementation | f69f9590edfa020ac42c53d187967f2848f3e8d7 | [
"MIT"
] | null | null | null | src/utils/common.py | DhyeySherasia/ANN-implementation | f69f9590edfa020ac42c53d187967f2848f3e8d7 | [
"MIT"
] | null | null | null | import yaml
def read_config(config_paht):
with open(config_paht) as config_file:
content = yaml.safe_load(config_file)
return content | 22.142857 | 45 | 0.716129 | import yaml
def read_config(config_paht):
with open(config_paht) as config_file:
content = yaml.safe_load(config_file)
return content | true | true |
1c09adc96a12a69cafbbeb80606eeb62dcd63c43 | 1,408 | py | Python | qinit_box/make_figures.py | rjleveque/shoaling_paper_figures | 4cd22188dff7e9797e6f1c5f5845fc5b420585bb | [
"BSD-3-Clause"
] | null | null | null | qinit_box/make_figures.py | rjleveque/shoaling_paper_figures | 4cd22188dff7e9797e6f1c5f5845fc5b420585bb | [
"BSD-3-Clause"
] | null | null | null | qinit_box/make_figures.py | rjleveque/shoaling_paper_figures | 4cd22188dff7e9797e6f1c5f5845fc5b420585bb | [
"BSD-3-Clause"
] | null | null | null |
from __future__ import print_function
from pylab import *
import os
from clawpack.clawutil.runclaw import runclaw
from clawpack.visclaw.frametools import plotframe
from clawpack.visclaw.data import ClawPlotData
import makegrid
from imp import reload
reload(makegrid)
run_code = True # set to False if output already... | 27.076923 | 68 | 0.679688 |
from __future__ import print_function
from pylab import *
import os
from clawpack.clawutil.runclaw import runclaw
from clawpack.visclaw.frametools import plotframe
from clawpack.visclaw.data import ClawPlotData
import makegrid
from imp import reload
reload(makegrid)
run_code = True if run_code:
os.system('... | true | true |
1c09aef37c038869bcd9cea167c3298ea527f6ad | 683 | py | Python | app/core/migrations/0002_tag.py | Przywek/recipe-app-api | f2f0f19b2edbcdca7b8320b7e24a669898c0a4a0 | [
"MIT"
] | null | null | null | app/core/migrations/0002_tag.py | Przywek/recipe-app-api | f2f0f19b2edbcdca7b8320b7e24a669898c0a4a0 | [
"MIT"
] | null | null | null | app/core/migrations/0002_tag.py | Przywek/recipe-app-api | f2f0f19b2edbcdca7b8320b7e24a669898c0a4a0 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-08-01 16:47
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 28.458333 | 118 | 0.616398 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Tag',
fields=[
... | true | true |
1c09af0986c11d4e90d43dd0ef49aebf3b749649 | 3,086 | py | Python | veinmind-backdoor/scan.py | Jqqzzz/veinmind-tools | d7d35880efb4f5f5ad4c3f4685f5d0f4ec8e404f | [
"MIT"
] | 364 | 2022-02-09T07:05:00.000Z | 2022-03-31T15:12:52.000Z | veinmind-backdoor/scan.py | Jqqzzz/veinmind-tools | d7d35880efb4f5f5ad4c3f4685f5d0f4ec8e404f | [
"MIT"
] | 9 | 2022-03-03T01:02:15.000Z | 2022-03-28T03:24:30.000Z | veinmind-backdoor/scan.py | Jqqzzz/veinmind-tools | d7d35880efb4f5f5ad4c3f4685f5d0f4ec8e404f | [
"MIT"
] | 62 | 2022-02-10T09:54:15.000Z | 2022-03-31T09:43:00.000Z | #!/usr/bin/env python3
import register
import click
import jsonpickle
import time as timep
import os, sys
from common import log
from common import tools
from veinmind import *
from plugins import *
sys.path.append(os.path.join(os.path.dirname(__file__), "../veinmind-common/python/service"))
sys.path.append(os.path.jo... | 40.077922 | 159 | 0.537913 | import register
import click
import jsonpickle
import time as timep
import os, sys
from common import log
from common import tools
from veinmind import *
from plugins import *
sys.path.append(os.path.join(os.path.dirname(__file__), "../veinmind-common/python/service"))
sys.path.append(os.path.join(os.path.dirname(__fi... | true | true |
1c09af3281665e7a6605b38813944513f89a8b69 | 7,287 | py | Python | mne/gui/tests/test_ieeg_locate_gui.py | twang5/mne-python | a885741c16abc21b5fccba85a3650a03f87e5e8f | [
"BSD-3-Clause"
] | null | null | null | mne/gui/tests/test_ieeg_locate_gui.py | twang5/mne-python | a885741c16abc21b5fccba85a3650a03f87e5e8f | [
"BSD-3-Clause"
] | null | null | null | mne/gui/tests/test_ieeg_locate_gui.py | twang5/mne-python | a885741c16abc21b5fccba85a3650a03f87e5e8f | [
"BSD-3-Clause"
] | null | null | null | # Authors: Alex Rockhill <aprockhill@mailbox.org>
#
# License: BSD-3-clause
import os.path as op
import numpy as np
from numpy.testing import assert_allclose
import pytest
import mne
from mne.datasets import testing
from mne.utils import requires_nibabel, requires_version
from mne.viz.utils import _fake_click
data_... | 37.369231 | 76 | 0.648964 |
import os.path as op
import numpy as np
from numpy.testing import assert_allclose
import pytest
import mne
from mne.datasets import testing
from mne.utils import requires_nibabel, requires_version
from mne.viz.utils import _fake_click
data_path = testing.data_path(download=False)
subject = 'sample'
subjects_dir = o... | true | true |
1c09af6fdd0cb96134a11a9c377f39ba4d44ac73 | 1,457 | py | Python | tests/test_visitors/test_ast/test_imports/test_protected_import.py | n1kolasM/wemake-python-styleguide | f39e87897de89bea1c49d410beb5b1cbaf930807 | [
"MIT"
] | 1 | 2020-02-08T12:04:39.000Z | 2020-02-08T12:04:39.000Z | tests/test_visitors/test_ast/test_imports/test_protected_import.py | n1kolasM/wemake-python-styleguide | f39e87897de89bea1c49d410beb5b1cbaf930807 | [
"MIT"
] | 1 | 2019-10-09T16:57:12.000Z | 2019-10-09T16:57:12.000Z | tests/test_visitors/test_ast/test_imports/test_protected_import.py | n1kolasM/wemake-python-styleguide | f39e87897de89bea1c49d410beb5b1cbaf930807 | [
"MIT"
] | 1 | 2019-12-12T19:18:58.000Z | 2019-12-12T19:18:58.000Z | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.best_practices import (
ProtectedModuleViolation,
)
from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor
import_public = 'import public'
import_protected = 'import _protected'
import_from_protected = 'from _pro... | 25.561404 | 76 | 0.757721 |
import pytest
from wemake_python_styleguide.violations.best_practices import (
ProtectedModuleViolation,
)
from wemake_python_styleguide.visitors.ast.imports import WrongImportVisitor
import_public = 'import public'
import_protected = 'import _protected'
import_from_protected = 'from _protected import something'... | true | true |
1c09afca4edeb7bdd0f0a8d20743c40f6265a9df | 5,374 | py | Python | core/model/losses.py | YFCodeDream/novelvqa | 63a6bdd91282d09685d98a7cdf3cc80b3783e048 | [
"Apache-2.0",
"MIT"
] | null | null | null | core/model/losses.py | YFCodeDream/novelvqa | 63a6bdd91282d09685d98a7cdf3cc80b3783e048 | [
"Apache-2.0",
"MIT"
] | null | null | null | core/model/losses.py | YFCodeDream/novelvqa | 63a6bdd91282d09685d98a7cdf3cc80b3783e048 | [
"Apache-2.0",
"MIT"
] | null | null | null | import torch
import torch.nn.functional as F
from torch import nn
from math import sqrt
import numpy as np
class ContrastProjection(nn.Module):
def __init__(self, __C):
super().__init__()
self.linear1 = nn.Linear(__C.HIDDEN_SIZE, __C.HIDDEN_SIZE)
self.linear2 = nn.Linear(__C.HIDDEN_SIZE, ... | 41.984375 | 135 | 0.596948 | import torch
import torch.nn.functional as F
from torch import nn
from math import sqrt
import numpy as np
class ContrastProjection(nn.Module):
def __init__(self, __C):
super().__init__()
self.linear1 = nn.Linear(__C.HIDDEN_SIZE, __C.HIDDEN_SIZE)
self.linear2 = nn.Linear(__C.HIDDEN_SIZE, ... | true | true |
1c09b121f662fa480120d4898b5a3471367a4341 | 962 | py | Python | app/__init__.py | benjaminbills/pitches | e80135ac7a80f0d974c04606ad4814a78b097958 | [
"MIT"
] | null | null | null | app/__init__.py | benjaminbills/pitches | e80135ac7a80f0d974c04606ad4814a78b097958 | [
"MIT"
] | null | null | null | app/__init__.py | benjaminbills/pitches | e80135ac7a80f0d974c04606ad4814a78b097958 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_login import LoginManager
from config import config_options
from flask_sqlalchemy import SQLAlchemy
from flask_wtf.csrf import CSRFProtect
from flask_mail import Mail
login_manager = LoginManager()
login_manager.session_protection = 'strong'
login_manager.login_view = 'auth.login'
ma... | 28.294118 | 63 | 0.765073 | from flask import Flask
from flask_login import LoginManager
from config import config_options
from flask_sqlalchemy import SQLAlchemy
from flask_wtf.csrf import CSRFProtect
from flask_mail import Mail
login_manager = LoginManager()
login_manager.session_protection = 'strong'
login_manager.login_view = 'auth.login'
ma... | true | true |
1c09b191b5f39cf4560300655366efa2879ee24d | 278 | py | Python | nopol/drawer.py | daphtdazz/nopol | 1017776acd9da696c0925f4ae3bcbb9bdad990ee | [
"Apache-2.0"
] | null | null | null | nopol/drawer.py | daphtdazz/nopol | 1017776acd9da696c0925f4ae3bcbb9bdad990ee | [
"Apache-2.0"
] | null | null | null | nopol/drawer.py | daphtdazz/nopol | 1017776acd9da696c0925f4ae3bcbb9bdad990ee | [
"Apache-2.0"
] | null | null | null | class Drawer:
def __init__(self, node):
self.base_node = node
def build(self):
raise NotImplementedError('Must implement build in a concrete subclass')
def draw(self):
raise NotImplementedError('Must implement draw in a concrete subclass')
| 27.8 | 80 | 0.68705 | class Drawer:
def __init__(self, node):
self.base_node = node
def build(self):
raise NotImplementedError('Must implement build in a concrete subclass')
def draw(self):
raise NotImplementedError('Must implement draw in a concrete subclass')
| true | true |
1c09b3506d1455199661a8d601f881665ffb8204 | 1,489 | py | Python | module_05/test_hello_world_setup_teardown.py | IvanJL/2021_python_selenium | 52ad0afa43664308437658966ec5d989a2db9c02 | [
"Unlicense"
] | null | null | null | module_05/test_hello_world_setup_teardown.py | IvanJL/2021_python_selenium | 52ad0afa43664308437658966ec5d989a2db9c02 | [
"Unlicense"
] | null | null | null | module_05/test_hello_world_setup_teardown.py | IvanJL/2021_python_selenium | 52ad0afa43664308437658966ec5d989a2db9c02 | [
"Unlicense"
] | null | null | null |
import pytest
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.support.wait import WebDriverWait
from common.webdriver_factory import get_driver
from module_05.sauce_fun_lib.inventory import get_inventory
from module_05.sauce_fun... | 35.452381 | 97 | 0.703828 |
import pytest
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.support.wait import WebDriverWait
from common.webdriver_factory import get_driver
from module_05.sauce_fun_lib.inventory import get_inventory
from module_05.sauce_fun... | true | true |
1c09b5493d0ff95ec717c0b6bc3ea423ba49aaa7 | 8,344 | py | Python | user_guide_examples/fundamental/fundamental_message_comm/endpoints/Battery.py | AadilLatif/HELICS-Examples | 2aa7e9e280b6cb96ee70e79802a68905e5002253 | [
"BSD-3-Clause"
] | 12 | 2019-05-07T07:39:22.000Z | 2022-03-24T19:11:23.000Z | user_guide_examples/fundamental/fundamental_message_comm/endpoints/Battery.py | AadilLatif/HELICS-Examples | 2aa7e9e280b6cb96ee70e79802a68905e5002253 | [
"BSD-3-Clause"
] | 44 | 2018-08-01T15:02:33.000Z | 2021-12-15T19:56:40.000Z | user_guide_examples/fundamental/fundamental_message_comm/endpoints/Battery.py | AadilLatif/HELICS-Examples | 2aa7e9e280b6cb96ee70e79802a68905e5002253 | [
"BSD-3-Clause"
] | 16 | 2018-09-21T03:01:28.000Z | 2022-02-13T06:59:01.000Z | # -*- coding: utf-8 -*-
"""
Created on 9/28/2020
This is a simple battery message federate that models an EV
battery as it is being charged. The federate receives a voltage signal
representing the voltage applied to the charging terminals of the battery
and based on its internally modeled SOC, calculates the current d... | 36.436681 | 83 | 0.622124 |
import helics as h
import logging
import numpy as np
import matplotlib.pyplot as plt
logger = logging.getLogger(__name__)
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)
def destroy_federate(fed):
grantedtime = h.helicsFederateRequestTime(fed, h.HELICS_TIME_MAXTIME)
statu... | true | true |
1c09b59313e804e08ea147d5bbec1b16c75182b2 | 2,247 | py | Python | linguistic_features/noun_VBN_dependent.py | iverinaivanova/Linguistic-Mechanisms-in-the-Section-Types-of-a-Research-Article | b9aad26d66a1b550f1734a76dd94b440e58b6125 | [
"Apache-2.0"
] | null | null | null | linguistic_features/noun_VBN_dependent.py | iverinaivanova/Linguistic-Mechanisms-in-the-Section-Types-of-a-Research-Article | b9aad26d66a1b550f1734a76dd94b440e58b6125 | [
"Apache-2.0"
] | null | null | null | linguistic_features/noun_VBN_dependent.py | iverinaivanova/Linguistic-Mechanisms-in-the-Section-Types-of-a-Research-Article | b9aad26d66a1b550f1734a76dd94b440e58b6125 | [
"Apache-2.0"
] | null | null | null | """The script retrieves the occurrences of nouns taking a past participle (VBN) dependent using spacy's
rule-based matching engine and then counts their number per article section.
The rule-based matching engine allows the search and the retrieval of exactly
defined token sequences and phrases such as the passive vo... | 40.125 | 104 | 0.574544 |
import spacy
from spacy.matcher import Matcher
from collections import Counter
nlp = spacy.load("en_core_web_sm")
matcher = Matcher(nlp.vocab)
f = open("abstracts.txt", "r", encoding="utf-8")
line_cnt = 0
for line in f:
if len(line) > 0:
items = line.split(" ")
if len(items) > 1:
... | true | true |
1c09b692e67fbb299ea2e5c6b234377f57fa3ccc | 406 | py | Python | teamProject/serviceRepairBackEnd/admin.py | LodolaTomas/RepairService | 77319597472d4bf93b5dd245877b3d5247b638c5 | [
"MIT"
] | 1 | 2022-03-10T07:46:17.000Z | 2022-03-10T07:46:17.000Z | teamProject/serviceRepairBackEnd/admin.py | EliFBaque/RepairService | 037779446fadb0e65cc0eae8e914e989d43641fe | [
"MIT"
] | null | null | null | teamProject/serviceRepairBackEnd/admin.py | EliFBaque/RepairService | 037779446fadb0e65cc0eae8e914e989d43641fe | [
"MIT"
] | 1 | 2021-12-28T02:45:52.000Z | 2021-12-28T02:45:52.000Z | from django.contrib import admin
from .models import Cliente , Tecnico , Tecnicos_Especialidad, Especialidades, Empleado
from .models import Room, Message
# Register your models here.
admin.site.register(Cliente)
admin.site.register(Tecnico)
admin.site.register(Tecnicos_Especialidad)
admin.site.register(Especialidades... | 33.833333 | 87 | 0.830049 | from django.contrib import admin
from .models import Cliente , Tecnico , Tecnicos_Especialidad, Especialidades, Empleado
from .models import Room, Message
admin.site.register(Cliente)
admin.site.register(Tecnico)
admin.site.register(Tecnicos_Especialidad)
admin.site.register(Especialidades)
admin.site.register(Emplead... | true | true |
1c09b6e00b13d319b01ef4113c8c029512a105d6 | 2,575 | py | Python | gaphor/RAAML/fta/andgate.py | mrmonkington/gaphor | f0fcd4deb90d24b14723840a689fac901f645a43 | [
"Apache-2.0"
] | 42 | 2015-01-21T09:52:32.000Z | 2017-12-29T08:15:28.000Z | gaphor/RAAML/fta/andgate.py | mrmonkington/gaphor | f0fcd4deb90d24b14723840a689fac901f645a43 | [
"Apache-2.0"
] | 1 | 2017-04-18T01:51:12.000Z | 2017-04-18T01:51:12.000Z | gaphor/RAAML/fta/andgate.py | mrmonkington/gaphor | f0fcd4deb90d24b14723840a689fac901f645a43 | [
"Apache-2.0"
] | 15 | 2015-01-02T15:23:03.000Z | 2017-12-15T11:43:10.000Z | """AND gate item definition."""
from math import pi
from gaphas.geometry import Rectangle
from gaphor.core.modeling import DrawContext
from gaphor.diagram.presentation import (
Classified,
ElementPresentation,
from_package_str,
)
from gaphor.diagram.shapes import Box, IconBox, Text, stroke
from gaphor.di... | 29.261364 | 88 | 0.628738 |
from math import pi
from gaphas.geometry import Rectangle
from gaphor.core.modeling import DrawContext
from gaphor.diagram.presentation import (
Classified,
ElementPresentation,
from_package_str,
)
from gaphor.diagram.shapes import Box, IconBox, Text, stroke
from gaphor.diagram.support import represents
... | true | true |
1c09b7302921a85a52273093b58e4ed7df0ff448 | 4,326 | py | Python | dpa/user/__init__.py | Clemson-DPA/dpa-pipe | 2482b8a0fd96dc19c0be4e82c3eaf0508914a968 | [
"MIT"
] | 55 | 2015-07-15T02:33:55.000Z | 2020-12-28T08:02:54.000Z | dpa/user/__init__.py | Clemson-DPA/dpa-pipe | 2482b8a0fd96dc19c0be4e82c3eaf0508914a968 | [
"MIT"
] | 5 | 2015-07-11T03:21:10.000Z | 2016-12-27T12:20:07.000Z | dpa/user/__init__.py | Clemson-DPA/dpa-pipe | 2482b8a0fd96dc19c0be4e82c3eaf0508914a968 | [
"MIT"
] | 12 | 2015-07-08T04:48:39.000Z | 2020-06-27T11:35:58.000Z | # -----------------------------------------------------------------------------
# Module: dpa.user
# Author: Josh Tomlinson (jtomlin@clemson.edu)
# -----------------------------------------------------------------------------
"""Classes and functions related to DPA pipeline users
Classes
-------
User
Read-only int... | 30.680851 | 79 | 0.417938 |
import os
try:
import pwd
except ImportError:
import getpass
pwd = None
from dateutil import parser as date_parser
from dpa.restful import ReadOnlyRestfulObject, RestfulObjectError
def current_username():
if pwd:
return pwd.getpwuid(os.geteuid()).pw_name
else:
return... | true | true |
1c09b7412f150e623c50f1724c2487d49e66fc14 | 1,230 | py | Python | 00_LIBRARIES/01_PANDAS/03_pandas_missing_data.py | san99tiago/ML_BASICS | ebd51827f7dd427c848b5c8e1d4bfd017d2fb56f | [
"MIT"
] | 2 | 2021-03-18T06:07:09.000Z | 2021-05-08T22:14:14.000Z | 00_LIBRARIES/01_PANDAS/03_pandas_missing_data.py | san99tiago/ML_BASICS | ebd51827f7dd427c848b5c8e1d4bfd017d2fb56f | [
"MIT"
] | null | null | null | 00_LIBRARIES/01_PANDAS/03_pandas_missing_data.py | san99tiago/ML_BASICS | ebd51827f7dd427c848b5c8e1d4bfd017d2fb56f | [
"MIT"
] | null | null | null | # HOW TO HANDLE MISSING DATA IN PANDAS
# Santiago Garcia Arango, June 2020
import numpy as np
import pandas as pd
# Create a dictionary with missing values (to show missing data examples)
dictionary = {
"A": [1, 2, np.nan, 5],
"B": [5, np.nan, np.nan, 2],
"C": [1, 2, 3, 4],
"D": [3, np.nan, 3, 5]
... | 33.243243 | 78 | 0.65122 |
import numpy as np
import pandas as pd
dictionary = {
"A": [1, 2, np.nan, 5],
"B": [5, np.nan, np.nan, 2],
"C": [1, 2, 3, 4],
"D": [3, np.nan, 3, 5]
}
data_frame = pd.DataFrame(dictionary)
print("data_frame=\n", data_frame, "\n")
print("data_frame.dropna() [delete NAN rows]=")
print(data_frame.d... | true | true |
1c09b8c9f95fd3ebffa523e80b7a731838d0840c | 19,448 | py | Python | purity_fb/purity_fb_1dot7/apis/buckets_api.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot7/apis/buckets_api.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot7/apis/buckets_api.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.7 Python SDK
Pure Storage FlashBlade REST 1.7 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.7
Contact: i... | 40.348548 | 204 | 0.566434 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class BucketsApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
sel... | true | true |
1c09b8deca3356c981e92502fa09050aec473823 | 2,333 | py | Python | datar/base/complex.py | stjordanis/datar | 4e2b5db026ad35918954576badef9951928c0cb1 | [
"MIT"
] | 110 | 2021-03-09T04:10:40.000Z | 2022-03-13T10:28:20.000Z | datar/base/complex.py | sthagen/datar | 1218a549e2f0547c7b5a824ca6d9adf1bf96ba46 | [
"MIT"
] | 54 | 2021-06-20T18:53:44.000Z | 2022-03-29T22:13:07.000Z | datar/base/complex.py | sthagen/datar | 1218a549e2f0547c7b5a824ca6d9adf1bf96ba46 | [
"MIT"
] | 11 | 2021-06-18T03:03:14.000Z | 2022-02-25T11:48:26.000Z | """Functions related to complex numbers"""
from typing import Any
import numpy
from pandas.core.dtypes.common import is_complex_dtype
from pipda import register_func
from ..core.utils import register_numpy_func_x
from ..core.types import ComplexOrIter
from ..core.contexts import Context
from .testing import _regist... | 20.286957 | 70 | 0.64252 | from typing import Any
import numpy
from pandas.core.dtypes.common import is_complex_dtype
from pipda import register_func
from ..core.utils import register_numpy_func_x
from ..core.types import ComplexOrIter
from ..core.contexts import Context
from .testing import _register_type_testing
from .casting import _as_ty... | true | true |
1c09b8f691ae15e1774b105aa90dcfba38fc1e67 | 5,746 | py | Python | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/openflow/bucket.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/openflow/bucket.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/openflow/bucket.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null |
# Copyright 1997 - 2018 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, p... | 35.689441 | 146 | 0.740167 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class Bucket(Base):
_SDM_NAME = 'bucket'
def __init__(self, parent):
super(Bucket, self).__init__(parent)
@property
def BucketAction(self):
from ixnetwork_restpy.testplatform.sessions.ixnetwork.vport.protoc... | true | true |
1c09b96c43de7539bd6598ad62963d950bea2513 | 757 | py | Python | my_receipts/apps/shops/admin.py | Tvrsch/my_receipts | 0a905d2366cee3b62f2dd083af1622afeb648bef | [
"MIT"
] | null | null | null | my_receipts/apps/shops/admin.py | Tvrsch/my_receipts | 0a905d2366cee3b62f2dd083af1622afeb648bef | [
"MIT"
] | null | null | null | my_receipts/apps/shops/admin.py | Tvrsch/my_receipts | 0a905d2366cee3b62f2dd083af1622afeb648bef | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import actions, models
@admin.register(models.Shop)
class ShopAdmin(admin.ModelAdmin):
list_display = ("name", "address", "is_removed", "receipts_count")
list_filter = (
"name",
"is_removed",
)
actions = (actions.merge_shops,)
def get_quer... | 24.419355 | 74 | 0.648613 | from django.contrib import admin
from . import actions, models
@admin.register(models.Shop)
class ShopAdmin(admin.ModelAdmin):
list_display = ("name", "address", "is_removed", "receipts_count")
list_filter = (
"name",
"is_removed",
)
actions = (actions.merge_shops,)
def get_quer... | true | true |
1c09ba36d55b56a153806051fd72da45686ee237 | 6,028 | py | Python | openstack_dashboard/dashboards/admin/volume_types/extras/tests.py | wilk/horizon | bdf7e692227367a928325acdd31088971d3c4ff4 | [
"Apache-2.0"
] | 1 | 2018-04-17T02:32:05.000Z | 2018-04-17T02:32:05.000Z | openstack_dashboard/dashboards/admin/volume_types/extras/tests.py | wilk/horizon | bdf7e692227367a928325acdd31088971d3c4ff4 | [
"Apache-2.0"
] | 3 | 2021-01-21T14:27:55.000Z | 2021-06-10T23:08:49.000Z | openstack_dashboard/dashboards/admin/volume_types/extras/tests.py | wilk/horizon | bdf7e692227367a928325acdd31088971d3c4ff4 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 42.751773 | 76 | 0.659423 |
from django.urls import reverse
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
class VolTypeExtrasTests(test.BaseAdminViewTests):
@test.create_mocks({api.cinder: ('volume_type_extra_get',
'volume_type_get')})
def test_list_extra... | true | true |
1c09ba3d12080022fa5ba6c8c0d4cbee41ec3ea6 | 5,103 | py | Python | mysite/polls/tests.py | michaelvdnest/django-mysite | 399798628a0c5bc744e6281d7c3e2746f287dad5 | [
"MIT"
] | null | null | null | mysite/polls/tests.py | michaelvdnest/django-mysite | 399798628a0c5bc744e6281d7c3e2746f287dad5 | [
"MIT"
] | null | null | null | mysite/polls/tests.py | michaelvdnest/django-mysite | 399798628a0c5bc744e6281d7c3e2746f287dad5 | [
"MIT"
] | null | null | null | import datetime
from django.test import TestCase
from django.utils import timezone
from django.urls import reverse
from .models import Question
# Create your tests here.
def create_question(question_text, days):
"""
Create a question with the given `question_text` and published the
given ... | 39.55814 | 88 | 0.639232 | import datetime
from django.test import TestCase
from django.utils import timezone
from django.urls import reverse
from .models import Question
def create_question(question_text, days):
time = timezone.now() + datetime.timedelta(days=days)
return Question.objects.create(question_text=question_t... | true | true |
1c09ba82117bd203c4e676d5bef1312f219026de | 456 | py | Python | propalyzer_site/propalyzer_app/tests/test_admin.py | toms3t/Propalyzer | 45845bf29494cb4191ad2118ab7d2a00046d2d9d | [
"MIT"
] | 58 | 2017-10-06T02:43:42.000Z | 2021-11-26T12:32:31.000Z | propalyzer_site/propalyzer_app/tests/test_admin.py | toms3t/Propalyzer | 45845bf29494cb4191ad2118ab7d2a00046d2d9d | [
"MIT"
] | 53 | 2017-10-06T02:36:38.000Z | 2022-03-12T00:51:06.000Z | propalyzer_site/propalyzer_app/tests/test_admin.py | toms3t/Propalyzer | 45845bf29494cb4191ad2118ab7d2a00046d2d9d | [
"MIT"
] | 32 | 2017-10-06T05:29:01.000Z | 2021-09-02T22:40:57.000Z | from django.contrib.auth.models import User
from django.test import TestCase
class PropertyAdminTest(TestCase):
def test_access_property_admin_should_be_accessible(self):
User.objects.create_superuser('admin', 'admin@pronto.com', 'admin')
self.client.login(username='admin', password='admin')
... | 35.076923 | 75 | 0.72807 | from django.contrib.auth.models import User
from django.test import TestCase
class PropertyAdminTest(TestCase):
def test_access_property_admin_should_be_accessible(self):
User.objects.create_superuser('admin', 'admin@pronto.com', 'admin')
self.client.login(username='admin', password='admin')
... | true | true |
1c09bad9953a5a8ceab5e287da1c5bcf95ea330c | 10,114 | py | Python | tools/targets/lint.py | mudassar-ublox/mbed-os | dd6482b9555c43cab2e80c9e3715edf1806f87d9 | [
"Apache-2.0"
] | 5 | 2018-05-19T03:58:36.000Z | 2021-03-23T00:48:36.000Z | tools/targets/lint.py | mudassar-ublox/mbed-os | dd6482b9555c43cab2e80c9e3715edf1806f87d9 | [
"Apache-2.0"
] | 6 | 2020-04-27T11:12:23.000Z | 2020-05-23T02:12:12.000Z | tools/targets/lint.py | mudassar-ublox/mbed-os | dd6482b9555c43cab2e80c9e3715edf1806f87d9 | [
"Apache-2.0"
] | 4 | 2019-03-06T14:34:37.000Z | 2020-12-29T07:03:57.000Z | """A linting utility for targets.json
This linting utility may be called as follows:
python <path-to>/lint.py targets TARGET [TARGET ...]
all targets will be linted
"""
# mbed SDK
# Copyright (c) 2017 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except i... | 36.381295 | 87 | 0.624975 | """A linting utility for targets.json
This linting utility may be called as follows:
python <path-to>/lint.py targets TARGET [TARGET ...]
all targets will be linted
"""
from os.path import join, abspath, dirname
if __name__ == "__main__":
import sys
ROOT = abspath(join(dirname(__file__), "..", ".."))
sy... | false | true |
1c09bb85cc1af0111afcaa4bcf0de76dd4221df9 | 819 | py | Python | speech_spiders/nihaowu/nihaowua-v2.py | SingularityZed/Python_Spider | d3e8bcd275a534729641d0ee43d689fba3a02c35 | [
"MIT"
] | 2 | 2019-01-26T09:34:35.000Z | 2019-04-15T07:21:01.000Z | speech_spiders/nihaowu/nihaowua-v2.py | SingularityZed/Python_Spider | d3e8bcd275a534729641d0ee43d689fba3a02c35 | [
"MIT"
] | null | null | null | speech_spiders/nihaowu/nihaowua-v2.py | SingularityZed/Python_Spider | d3e8bcd275a534729641d0ee43d689fba3a02c35 | [
"MIT"
] | 1 | 2020-10-13T23:09:56.000Z | 2020-10-13T23:09:56.000Z | import requests
import random
from lxml import etree
from fake_useragent import UserAgent
def get_random_ua(): #随机UA
ua = UserAgent()
return ua.random
headers = {
'User-Agent': get_random_ua()
}
url = 'https://www.nihaowua.com/'
def main(): #写入txt文本程序
count = 0
with open("NiHaoWu.txt", "a") as f... | 26.419355 | 71 | 0.543346 | import requests
import random
from lxml import etree
from fake_useragent import UserAgent
def get_random_ua(): ua = UserAgent()
return ua.random
headers = {
'User-Agent': get_random_ua()
}
url = 'https://www.nihaowua.com/'
def main(): count = 0
with open("NiHaoWu.txt", "a") as f:
whi... | true | true |
1c09bbadac86ac2f980fd7c1970a39fb94edbd03 | 3,455 | py | Python | invana_engine/gremlin/stats.py | rrmerugu/invana-engine | fc3f44b1417f3399b5a7e8414717c30eb4f78e0b | [
"Apache-2.0"
] | 9 | 2020-09-28T12:56:04.000Z | 2021-07-13T22:50:44.000Z | invana_engine/gremlin/stats.py | rrmerugu/invana-engine | fc3f44b1417f3399b5a7e8414717c30eb4f78e0b | [
"Apache-2.0"
] | 4 | 2020-12-22T02:42:32.000Z | 2021-03-16T10:47:57.000Z | invana_engine/gremlin/stats.py | rrmerugu/invana-engine | fc3f44b1417f3399b5a7e8414717c30eb4f78e0b | [
"Apache-2.0"
] | 2 | 2021-06-17T04:53:27.000Z | 2021-11-20T19:06:11.000Z | from .base import GremlinOperationBase
from invana_engine.server.settings import MANAGEMENT_VERTEX_NAME
class StatsOps(GremlinOperationBase):
def get_vertices_label_stats(self, label: str = None, namespace: str = None, limit: int = None, order: str = None):
stats = self.gremlin_client.g.V().label().group... | 38.820225 | 119 | 0.525326 | from .base import GremlinOperationBase
from invana_engine.server.settings import MANAGEMENT_VERTEX_NAME
class StatsOps(GremlinOperationBase):
def get_vertices_label_stats(self, label: str = None, namespace: str = None, limit: int = None, order: str = None):
stats = self.gremlin_client.g.V().label().group... | true | true |
1c09bc01909306da1ab6496184cd6693f3124432 | 5,053 | py | Python | homeassistant/components/sensor/rfxtrx.py | maihde/home-assistant | 688d70644949a658e0607e52b3896a2c4c8a85e7 | [
"Apache-2.0"
] | 2 | 2018-01-15T06:36:11.000Z | 2019-06-06T14:08:01.000Z | homeassistant/components/sensor/rfxtrx.py | maihde/home-assistant | 688d70644949a658e0607e52b3896a2c4c8a85e7 | [
"Apache-2.0"
] | 5 | 2022-03-01T06:31:03.000Z | 2022-03-31T07:20:45.000Z | homeassistant/components/sensor/rfxtrx.py | maihde/home-assistant | 688d70644949a658e0607e52b3896a2c4c8a85e7 | [
"Apache-2.0"
] | 1 | 2019-12-06T21:18:54.000Z | 2019-12-06T21:18:54.000Z | """
Support for RFXtrx sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.rfxtrx/
"""
import logging
import voluptuous as vol
import homeassistant.components.rfxtrx as rfxtrx
import homeassistant.helpers.config_validation as cv
from homeass... | 34.37415 | 79 | 0.63111 | import logging
import voluptuous as vol
import homeassistant.components.rfxtrx as rfxtrx
import homeassistant.helpers.config_validation as cv
from homeassistant.const import ATTR_ENTITY_ID, CONF_NAME
from homeassistant.helpers.entity import Entity
from homeassistant.util import slugify
from homeassistant.components.s... | true | true |
1c09bc1d567d8791abd7c624f610197c5a6bb89c | 7,234 | py | Python | homeassistant/components/websocket_api/messages.py | eyager1/core | c0ae31d86c841107930cf471fd60d65b5c163f16 | [
"Apache-2.0"
] | 2 | 2019-06-18T10:57:33.000Z | 2019-06-20T13:39:46.000Z | homeassistant/components/websocket_api/messages.py | eyager1/core | c0ae31d86c841107930cf471fd60d65b5c163f16 | [
"Apache-2.0"
] | 1,016 | 2019-06-18T21:27:47.000Z | 2020-03-06T11:09:58.000Z | homeassistant/components/websocket_api/messages.py | eyager1/core | c0ae31d86c841107930cf471fd60d65b5c163f16 | [
"Apache-2.0"
] | null | null | null | """Message templates for websocket commands."""
from __future__ import annotations
from functools import lru_cache
import logging
from typing import Any, Final
import voluptuous as vol
from homeassistant.core import Event, State
from homeassistant.helpers import config_validation as cv
from homeassistant.util.json i... | 34.61244 | 88 | 0.698369 | from __future__ import annotations
from functools import lru_cache
import logging
from typing import Any, Final
import voluptuous as vol
from homeassistant.core import Event, State
from homeassistant.helpers import config_validation as cv
from homeassistant.util.json import (
find_paths_unserializable_data,
... | true | true |
1c09bc7b12a1e93de27dab4fd91442fbf7b1765f | 295 | py | Python | Test1.py | AdityaPai2398/OpenCV-Playground | 70969d9b60dc2e83e44c23632986b96d43eb2e95 | [
"MIT"
] | 1 | 2018-06-25T07:28:30.000Z | 2018-06-25T07:28:30.000Z | Test1.py | AdityaPai2398/OpenCV-Playground | 70969d9b60dc2e83e44c23632986b96d43eb2e95 | [
"MIT"
] | null | null | null | Test1.py | AdityaPai2398/OpenCV-Playground | 70969d9b60dc2e83e44c23632986b96d43eb2e95 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
#load image
img = cv2.imread('Lenna.png',0)
cv2.imshow('This is Lenna',img)
pressedKey = cv2.waitKey(0)
if pressedKey == 27:
cv2.destroyAllWindows()
elif pressedKey == ord('s'):
cv2.imwrite('grey.png',img)
cv2.destroyAllWindows()
| 18.4375 | 36 | 0.644068 | import numpy as np
import cv2
img = cv2.imread('Lenna.png',0)
cv2.imshow('This is Lenna',img)
pressedKey = cv2.waitKey(0)
if pressedKey == 27:
cv2.destroyAllWindows()
elif pressedKey == ord('s'):
cv2.imwrite('grey.png',img)
cv2.destroyAllWindows()
| true | true |
1c09bcbb5a885bcbbb8d4809e19a67db1c3caccd | 18,182 | py | Python | tensorflow/contrib/slim/python/slim/nets/resnet_v2_test.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 22 | 2017-06-26T01:27:45.000Z | 2021-06-23T10:00:31.000Z | tensorflow/contrib/slim/python/slim/nets/resnet_v2_test.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 7 | 2017-07-13T09:40:59.000Z | 2019-04-08T22:46:51.000Z | tensorflow/contrib/slim/python/slim/nets/resnet_v2_test.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 38 | 2017-04-28T04:15:48.000Z | 2019-09-28T05:11:46.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.511416 | 80 | 0.647839 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib import layers
from tensorflow.contrib.framework.python.ops import arg_scope
from tensorflow.contrib.layers.python.layers import utils
from tensorflow.contrib.slim.py... | true | true |
1c09bdb9825321c4fa41fbbe8a9f20e315b5335a | 1,528 | py | Python | medical_prescription/prescription/validators/patternvalidator.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 11 | 2017-09-19T00:29:40.000Z | 2018-04-05T23:52:39.000Z | medical_prescription/prescription/validators/patternvalidator.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 271 | 2017-09-09T00:07:28.000Z | 2017-12-07T05:00:45.000Z | medical_prescription/prescription/validators/patternvalidator.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 26 | 2017-08-31T20:48:49.000Z | 2018-03-21T15:11:27.000Z | # django
from django import forms
from django.utils.translation import ugettext_lazy as _
# local django
from prescription import constants
class PatternValidator():
"""
Validating custom Message and Response fields.
"""
# Validating name.
def validator_name(self, name):
if name is not N... | 36.380952 | 81 | 0.680628 | from django import forms
from django.utils.translation import ugettext_lazy as _
from prescription import constants
class PatternValidator():
def validator_name(self, name):
if name is not None and len(name) > constants.MAX_LENGTH_NAME:
raise forms.ValidationError({'name': [_(constants.L... | true | true |
1c09bdcb1ca305f85f59f338ce73140b1d4eb437 | 12,330 | py | Python | Funções Analíticas/Virtualenv/Lib/site-packages/matplotlib/type1font.py | Leonardo-Maciel/PSO_Maciel | 3939448da45716260f3ac7811afdd13be670f346 | [
"MIT"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | Funções Analíticas/Virtualenv/Lib/site-packages/matplotlib/type1font.py | Leonardo-Maciel/PSO_Maciel | 3939448da45716260f3ac7811afdd13be670f346 | [
"MIT"
] | 21 | 2021-04-13T01:17:40.000Z | 2022-03-11T16:06:50.000Z | Funções Analíticas/Virtualenv/Lib/site-packages/matplotlib/type1font.py | Leonardo-Maciel/PSO_Maciel | 3939448da45716260f3ac7811afdd13be670f346 | [
"MIT"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | """
A class representing a Type 1 font.
This version reads pfa and pfb files and splits them for embedding in
pdf files. It also supports SlantFont and ExtendFont transformations,
similarly to pdfTeX and friends. There is no support yet for subsetting.
Usage::
>>> font = Type1Font(filename)
>>> clear_part, enc... | 36.916168 | 79 | 0.499189 |
import binascii
import enum
import itertools
import re
import struct
import numpy as np
_TokenType = enum.Enum('_TokenType',
'whitespace name string delimiter number')
class Type1Font:
__slots__ = ('parts', 'prop')
def __init__(self, input):
if isinstance(input, tuple) and ... | true | true |
1c09bdd5f449e6fa9c5c148897945b98e3e77bb3 | 1,572 | py | Python | Day 40/HalloweenSale.py | sandeep-krishna/100DaysOfCode | af4594fb6933e4281d298fa921311ccc07295a7c | [
"MIT"
] | null | null | null | Day 40/HalloweenSale.py | sandeep-krishna/100DaysOfCode | af4594fb6933e4281d298fa921311ccc07295a7c | [
"MIT"
] | null | null | null | Day 40/HalloweenSale.py | sandeep-krishna/100DaysOfCode | af4594fb6933e4281d298fa921311ccc07295a7c | [
"MIT"
] | null | null | null | '''
You wish to buy video games from the famous online video game store Mist.
Usually, all games are sold at the same price, dollars. However, they are planning to have the seasonal Halloween Sale next month in which you can buy games at a cheaper price. Specifically, the first game you buy during the sale will be sol... | 32.75 | 504 | 0.698473 |
import math
import os
import random
import re
import sys
def howManyGames(p, d, m, s):
games = 0
while s >= 0:
s -= p
p = max(p - d, m)
games += 1
return games - 1
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
pdms = input().split()
p = int(pd... | true | true |
1c09be47211a572c3f3bb9841f23e156981e13b7 | 10,149 | py | Python | numerical_examples/strong_scaling_bare_metal/devito_docker/devito/tools/data_structures.py | slimgroup/ServerlessImagingAWS | 848af0632f2fac57123ae765f6813673f3f37af5 | [
"MIT"
] | null | null | null | numerical_examples/strong_scaling_bare_metal/devito_docker/devito/tools/data_structures.py | slimgroup/ServerlessImagingAWS | 848af0632f2fac57123ae765f6813673f3f37af5 | [
"MIT"
] | null | null | null | numerical_examples/strong_scaling_bare_metal/devito_docker/devito/tools/data_structures.py | slimgroup/ServerlessImagingAWS | 848af0632f2fac57123ae765f6813673f3f37af5 | [
"MIT"
] | null | null | null | from collections import Callable, Iterable, OrderedDict, Mapping, deque
from functools import reduce
import numpy as np
from multidict import MultiDict
from devito.tools.utils import as_tuple, filter_ordered
from devito.tools.algorithms import toposort
__all__ = ['Bunch', 'EnrichedTuple', 'ReducerMap', 'DefaultOrder... | 31.421053 | 85 | 0.590206 | from collections import Callable, Iterable, OrderedDict, Mapping, deque
from functools import reduce
import numpy as np
from multidict import MultiDict
from devito.tools.utils import as_tuple, filter_ordered
from devito.tools.algorithms import toposort
__all__ = ['Bunch', 'EnrichedTuple', 'ReducerMap', 'DefaultOrder... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.