hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2b0f1ae13427ff0ae9ad22417d98eefea202f7 | 62,178 | py | Python | bigtable/google/cloud/bigtable_v2/proto/bigtable_pb2.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 2 | 2021-11-26T07:08:43.000Z | 2022-03-07T20:20:04.000Z | bigtable/google/cloud/bigtable_v2/proto/bigtable_pb2.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 6 | 2019-05-27T22:05:58.000Z | 2019-08-05T16:46:16.000Z | bigtable/google/cloud/bigtable_v2/proto/bigtable_pb2.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 1 | 2021-07-21T17:59:33.000Z | 2021-07-21T17:59:33.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/bigtable_v2/proto/bigtable.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import messa... | 35.878823 | 4,612 | 0.629515 |
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
... | true | true |
1c2b0f985ef8e35ab5fe8006ac361bf9a33ddac1 | 18,262 | py | Python | openpeerpower/components/xiaomi_miio/vacuum.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 1 | 2021-07-08T20:09:55.000Z | 2021-07-08T20:09:55.000Z | openpeerpower/components/xiaomi_miio/vacuum.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 47 | 2021-02-21T23:43:07.000Z | 2022-03-31T06:07:10.000Z | openpeerpower/components/xiaomi_miio/vacuum.py | OpenPeerPower/core | f673dfac9f2d0c48fa30af37b0a99df9dd6640ee | [
"Apache-2.0"
] | null | null | null | """Support for the Xiaomi vacuum cleaner robot."""
from functools import partial
import logging
from miio import DeviceException, Vacuum
import voluptuous as vol
from openpeerpower.components.vacuum import (
ATTR_CLEANED_AREA,
PLATFORM_SCHEMA,
STATE_CLEANING,
STATE_DOCKED,
STATE_ERROR,
STATE_I... | 34.718631 | 111 | 0.59966 | from functools import partial
import logging
from miio import DeviceException, Vacuum
import voluptuous as vol
from openpeerpower.components.vacuum import (
ATTR_CLEANED_AREA,
PLATFORM_SCHEMA,
STATE_CLEANING,
STATE_DOCKED,
STATE_ERROR,
STATE_IDLE,
STATE_PAUSED,
STATE_RETURNING,
SUP... | true | true |
1c2b101cc49648ec3fb251fd993a7676d6e524ba | 110 | py | Python | gui/theme.py | YannThorimbert/FantasyStrategia | e9e26cbd95faba6f1223aaa34bc0b2c6e60cf5f5 | [
"MIT"
] | null | null | null | gui/theme.py | YannThorimbert/FantasyStrategia | e9e26cbd95faba6f1223aaa34bc0b2c6e60cf5f5 | [
"MIT"
] | null | null | null | gui/theme.py | YannThorimbert/FantasyStrategia | e9e26cbd95faba6f1223aaa34bc0b2c6e60cf5f5 | [
"MIT"
] | null | null | null | import thorpy
def set_theme(theme):
thorpy.set_theme(theme)
thorpy.style.DEF_COLOR = (150,150,150)
| 13.75 | 42 | 0.709091 | import thorpy
def set_theme(theme):
thorpy.set_theme(theme)
thorpy.style.DEF_COLOR = (150,150,150)
| true | true |
1c2b10e1d2d7618f869f5dc83857e9caf1174723 | 3,877 | py | Python | nipype/interfaces/fsl/possum.py | mfalkiewicz/nipype | 775e21b78fb1ffa2ff9cb12e6f052868bd44d052 | [
"Apache-2.0"
] | 1 | 2015-01-19T13:12:27.000Z | 2015-01-19T13:12:27.000Z | nipype/interfaces/fsl/possum.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/fsl/possum.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
The possum module provides classes for interfacing with `POSSUM
<http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/POSSUM>`_ command line tools.
Please, check out the l... | 42.604396 | 100 | 0.622904 |
from .base import FSLCommand, FSLCommandInputSpec
from ..base import TraitedSpec, File, traits
class B0CalcInputSpec(FSLCommandInputSpec):
in_file = File(exists=True, mandatory=True, argstr='-i %s', position=0,
desc='filename of input image (usually a tissue/air segmentation)')
out_fil... | true | true |
1c2b112f87c0b3e81cdf00f95790f71463ad4e52 | 269 | py | Python | tester_web/tables/__init__.py | Ma-Jun-a/TMW_backend | 32e15d18ee826c8b4167041690b33c417076b0d7 | [
"MIT"
] | null | null | null | tester_web/tables/__init__.py | Ma-Jun-a/TMW_backend | 32e15d18ee826c8b4167041690b33c417076b0d7 | [
"MIT"
] | null | null | null | tester_web/tables/__init__.py | Ma-Jun-a/TMW_backend | 32e15d18ee826c8b4167041690b33c417076b0d7 | [
"MIT"
] | null | null | null | #执行此方法依据模型建表
from sqlalchemy.orm import sessionmaker
from tester_web.tables.user import Model, engine
def init_db():
Model.metadata.create_all(bind=engine)
# 先迁移模型完成后 再初始化session
# init_db()
Session = sessionmaker()
db_session = Session(bind=engine) | 20.692308 | 49 | 0.750929 |
from sqlalchemy.orm import sessionmaker
from tester_web.tables.user import Model, engine
def init_db():
Model.metadata.create_all(bind=engine)
Session = sessionmaker()
db_session = Session(bind=engine) | true | true |
1c2b1196866d2ab7c2c40f6972b59e183b485d0e | 417 | py | Python | tests/functional/config_files/config.py | elementechemlyn/pdssandpit | 0c3eff557b00ca721919135d804878a6ab583016 | [
"MIT"
] | null | null | null | tests/functional/config_files/config.py | elementechemlyn/pdssandpit | 0c3eff557b00ca721919135d804878a6ab583016 | [
"MIT"
] | null | null | null | tests/functional/config_files/config.py | elementechemlyn/pdssandpit | 0c3eff557b00ca721919135d804878a6ab583016 | [
"MIT"
] | null | null | null | from .environment import ENV
# Apigee Details
ENVIRONMENT = ENV["environment"]
BASE_URL = f"https://{ENVIRONMENT}.api.service.nhs.uk"
# Unattended access details
APPLICATION_RESTRICTED_API_KEY = ENV["application_restricted_api_key"]
SIGNING_KEY = ENV["signing_key"]
KEY_ID = ENV["key_id"]
# PDS
PDS_BASE_PATH = ENV["... | 21.947368 | 70 | 0.767386 | from .environment import ENV
ENVIRONMENT = ENV["environment"]
BASE_URL = f"https://{ENVIRONMENT}.api.service.nhs.uk"
APPLICATION_RESTRICTED_API_KEY = ENV["application_restricted_api_key"]
SIGNING_KEY = ENV["signing_key"]
KEY_ID = ENV["key_id"]
PDS_BASE_PATH = ENV["pds_base_path"]
CLIENT_ID = ENV['client_id']
C... | true | true |
1c2b11f5ebeb7193ca31b4b1407ed0dbc832c795 | 502 | py | Python | js_events/migrations/0026_eventsconfig_allow_post.py | evgeny-dmi3ev/js-events | 766fea79591ad0c4d2c0fcd5580f9699aa232c29 | [
"BSD-3-Clause"
] | null | null | null | js_events/migrations/0026_eventsconfig_allow_post.py | evgeny-dmi3ev/js-events | 766fea79591ad0c4d2c0fcd5580f9699aa232c29 | [
"BSD-3-Clause"
] | null | null | null | js_events/migrations/0026_eventsconfig_allow_post.py | evgeny-dmi3ev/js-events | 766fea79591ad0c4d2c0fcd5580f9699aa232c29 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-08-28 15:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('js_events', '0025_create_placeholders'),
]
operations = [
migrations.AddFi... | 23.904762 | 89 | 0.641434 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('js_events', '0025_create_placeholders'),
]
operations = [
migrations.AddField(
model_name='eventsconfig',
name='allow_post... | true | true |
1c2b12c18e1552b07dc7dbe9e5f32552a7e7e8b6 | 3,073 | py | Python | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/jira_object_dataset.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/jira_object_dataset.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/jira_object_dataset.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 42.09589 | 94 | 0.645298 |
from .dataset import Dataset
class JiraObjectDataset(Dataset):
_validation = {
'linked_service_name': {'required': True},
'type': {'required': True},
}
_attribute_map = {
'additional_properties': {'key': '', 'type': '{object}'},
'description': {'key': 'descript... | true | true |
1c2b12ca1a7d5f6be3a49a9439835fd39b13bb6f | 39,095 | py | Python | tests/test_optimize.py | rmoyard/pennylane | 14fdee89d8c3673840708b002c304aee4b31c507 | [
"Apache-2.0"
] | 3 | 2021-02-22T18:30:55.000Z | 2021-02-23T10:54:58.000Z | tests/test_optimize.py | rmoyard/pennylane | 14fdee89d8c3673840708b002c304aee4b31c507 | [
"Apache-2.0"
] | null | null | null | tests/test_optimize.py | rmoyard/pennylane | 14fdee89d8c3673840708b002c304aee4b31c507 | [
"Apache-2.0"
] | 1 | 2021-03-27T09:03:15.000Z | 2021-03-27T09:03:15.000Z | # Copyright 2018-2020 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 40.015353 | 108 | 0.614503 |
import itertools as it
import numpy as onp
import pytest
import pennylane as qml
from pennylane import numpy as np
from pennylane.optimize import (
GradientDescentOptimizer,
MomentumOptimizer,
NesterovMomentumOptimizer,
AdagradOptimizer,
RMSPropOptimizer,
AdamOptimizer,
Rotos... | true | true |
1c2b137919800c11b9af9def7b77d30093b844cf | 3,324 | py | Python | lib/carbon/tests/benchmark_cache.py | readevalprint/carbon | 5264d53a3ed6f97721ae76ae3821ca8ce4950a66 | [
"Apache-2.0"
] | 961 | 2015-01-01T14:20:35.000Z | 2022-03-29T22:15:35.000Z | lib/carbon/tests/benchmark_cache.py | readevalprint/carbon | 5264d53a3ed6f97721ae76ae3821ca8ce4950a66 | [
"Apache-2.0"
] | 611 | 2015-01-03T20:31:23.000Z | 2022-03-31T21:30:23.000Z | lib/carbon/tests/benchmark_cache.py | readevalprint/carbon | 5264d53a3ed6f97721ae76ae3821ca8ce4950a66 | [
"Apache-2.0"
] | 326 | 2015-01-03T14:55:33.000Z | 2022-03-31T01:43:49.000Z | import timeit
from carbon.cache import _MetricCache, DrainStrategy, \
NaiveStrategy, MaxStrategy, RandomStrategy, SortedStrategy, \
TimeSortedStrategy, BucketMaxStrategy
metric_cache = _MetricCache(DrainStrategy)
count = 0
strategies = {
'naive': NaiveStrategy,
'max': MaxStrategy,
'random': Rando... | 32.271845 | 81 | 0.620638 | import timeit
from carbon.cache import _MetricCache, DrainStrategy, \
NaiveStrategy, MaxStrategy, RandomStrategy, SortedStrategy, \
TimeSortedStrategy, BucketMaxStrategy
metric_cache = _MetricCache(DrainStrategy)
count = 0
strategies = {
'naive': NaiveStrategy,
'max': MaxStrategy,
'random': Rando... | true | true |
1c2b14c77c1356483a7ac7cfe0ef500bc57ab76f | 10,555 | py | Python | rllib/env/atari_wrappers.py | fbudrowski/ray | 4853aa96cbbea76e69c3e48802ce7408f08669ee | [
"Apache-2.0"
] | null | null | null | rllib/env/atari_wrappers.py | fbudrowski/ray | 4853aa96cbbea76e69c3e48802ce7408f08669ee | [
"Apache-2.0"
] | 5 | 2021-08-25T16:17:15.000Z | 2022-03-12T01:00:29.000Z | rllib/env/atari_wrappers.py | fbudrowski/ray | 4853aa96cbbea76e69c3e48802ce7408f08669ee | [
"Apache-2.0"
] | 2 | 2020-05-22T15:36:27.000Z | 2020-05-22T15:52:03.000Z | import numpy as np
from collections import deque
import gym
from gym import spaces
import cv2
cv2.ocl.setUseOpenCL(False)
def is_atari(env):
if (hasattr(env.observation_space, "shape")
and env.observation_space.shape is not None
and len(env.observation_space.shape) <= 2):
return Fa... | 32.984375 | 80 | 0.61099 | import numpy as np
from collections import deque
import gym
from gym import spaces
import cv2
cv2.ocl.setUseOpenCL(False)
def is_atari(env):
if (hasattr(env.observation_space, "shape")
and env.observation_space.shape is not None
and len(env.observation_space.shape) <= 2):
return Fa... | true | true |
1c2b16be4e7a1c043617782a7bd0de87fc9ab569 | 2,934 | py | Python | examples/reproducing/hunziker2015.py | prisae/empymod | c01eae0ac51b37864c0b68bf0c207c1bd7c7e585 | [
"Apache-2.0"
] | 31 | 2017-06-07T00:47:10.000Z | 2020-11-02T13:45:29.000Z | examples/reproducing/hunziker2015.py | prisae/empymod | c01eae0ac51b37864c0b68bf0c207c1bd7c7e585 | [
"Apache-2.0"
] | 97 | 2017-06-05T08:19:27.000Z | 2020-11-30T15:25:07.000Z | examples/reproducing/hunziker2015.py | prisae/empymod | c01eae0ac51b37864c0b68bf0c207c1bd7c7e585 | [
"Apache-2.0"
] | 14 | 2017-11-05T13:24:29.000Z | 2020-09-25T19:25:18.000Z | """
Hunziker et al., 2015, Geophysics
=================================
Reproducing Figure 3 of the manual from `EMmod`. This example does, as such,
not actually reproduce a figure of Hunziker et al., 2015, but of the manual
that comes with the software accompanying the paper. With the software comes an
example input ... | 28.764706 | 79 | 0.578391 |
import empymod
import numpy as np
import matplotlib.pyplot as plt
| true | true |
1c2b187d41fee478aa7d74702fd8de6b79deee2c | 49,508 | py | Python | lib/coins.py | lancehall123/electrumx | b1cf21900a4fc45a821d920f1ce0a36950577d0c | [
"MIT"
] | null | null | null | lib/coins.py | lancehall123/electrumx | b1cf21900a4fc45a821d920f1ce0a36950577d0c | [
"MIT"
] | null | null | null | lib/coins.py | lancehall123/electrumx | b1cf21900a4fc45a821d920f1ce0a36950577d0c | [
"MIT"
] | null | null | null | # Copyright (c) 2016-2017, Neil Booth
# Copyright (c) 2017, the ElectrumX authors
#
# All rights reserved.
#
# The MIT License (MIT)
#
# 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 ... | 31.533758 | 114 | 0.648723 |
from collections import namedtuple
import re
import struct
from decimal import Decimal
from hashlib import sha256
from functools import partial
import base64
import lib.util as util
from lib.hash import Base58, hash160, double_sha256, hash_to_str
from lib.script import ScriptPubKey, OpCodes
... | true | true |
1c2b194566a9e96dba834338ec915a2289eb1837 | 682 | py | Python | functions/markdown-to-html/markdown2html.py | truls/faas-profiler | d54ca0d9926f38c693f616ba4d08414aea823f51 | [
"MIT"
] | null | null | null | functions/markdown-to-html/markdown2html.py | truls/faas-profiler | d54ca0d9926f38c693f616ba4d08414aea823f51 | [
"MIT"
] | null | null | null | functions/markdown-to-html/markdown2html.py | truls/faas-profiler | d54ca0d9926f38c693f616ba4d08414aea823f51 | [
"MIT"
] | null | null | null | # Copyright (c) 2019 Princeton University
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from markdown import markdown
import base64
import json
import base64
def main(params):
try:
md = json.loads(base64.decodebytes(params["__... | 29.652174 | 108 | 0.690616 |
from markdown import markdown
import base64
import json
import base64
def main(params):
try:
md = json.loads(base64.decodebytes(params["__ow_body"].encode("utf-8")))["markdown"].encode("utf-8")
md_text = base64.decodebytes(md).decode("utf-8")
except KeyError:
return {'Error' : 'Pos... | true | true |
1c2b1a1f7735b02e97f5b6e0193d9fd6cf1a373c | 6,205 | py | Python | 09_Recurrent_Neural_Networks/02_Implementing_RNN_for_Spam_Prediction/02_implementing_rnn.py | dolaameng/tensorflow_cookbook | ca9bcb892239e9276e9348689e06cd6d1edd19ef | [
"MIT"
] | null | null | null | 09_Recurrent_Neural_Networks/02_Implementing_RNN_for_Spam_Prediction/02_implementing_rnn.py | dolaameng/tensorflow_cookbook | ca9bcb892239e9276e9348689e06cd6d1edd19ef | [
"MIT"
] | null | null | null | 09_Recurrent_Neural_Networks/02_Implementing_RNN_for_Spam_Prediction/02_implementing_rnn.py | dolaameng/tensorflow_cookbook | ca9bcb892239e9276e9348689e06cd6d1edd19ef | [
"MIT"
] | 1 | 2018-04-25T17:10:22.000Z | 2018-04-25T17:10:22.000Z | # Implementing an RNN in TensorFlow
#----------------------------------
#
# We implement an RNN in TensorFlow to predict spam/ham from texts
#
import os
import re
import io
import requests
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from zipfile import ZipFile
from tensorflow.python.fram... | 33.907104 | 111 | 0.714424 |
import os
import re
import io
import requests
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from zipfile import ZipFile
from tensorflow.python.framework import ops
ops.reset_default_graph()
sess = tf.Session()
epochs = 20
batch_size = 250
max_sequence_length = 25
rnn_size = 10
emb... | true | true |
1c2b1a59f09f774fe08b5b66ca33edcbb2313f3a | 925 | py | Python | carbon/client/metrics/timer.py | mosquito/carbonate | 5eca69602b9fc03dc0b982f9104c7ebb04159059 | [
"MIT"
] | 2 | 2017-12-21T15:40:12.000Z | 2018-02-07T10:00:14.000Z | carbon/client/metrics/timer.py | mosquito/carbonate | 5eca69602b9fc03dc0b982f9104c7ebb04159059 | [
"MIT"
] | 2 | 2016-12-02T08:53:48.000Z | 2016-12-05T21:46:04.000Z | carbon/client/metrics/timer.py | mosquito/carbonate | 5eca69602b9fc03dc0b982f9104c7ebb04159059 | [
"MIT"
] | 5 | 2015-07-22T14:31:28.000Z | 2020-09-30T08:20:29.000Z | # encoding: utf-8
from time import time
from threading import RLock
from carbon.client.metrics.base import MeasurerBase, Metric
class StopWatch(object):
__slots__ = '_lock', '_current'
def __init__(self):
self._lock = RLock()
self._current = None
def start(self):
with self._lock:... | 23.125 | 65 | 0.632432 |
from time import time
from threading import RLock
from carbon.client.metrics.base import MeasurerBase, Metric
class StopWatch(object):
__slots__ = '_lock', '_current'
def __init__(self):
self._lock = RLock()
self._current = None
def start(self):
with self._lock:
self... | true | true |
1c2b1a6f4bbfe3d44da0ea4bdb00ceaaf3fb1cd7 | 181 | py | Python | test_data/parse/unexpected/class_definitions/unexpected_double_description_for_a_property/meta_model.py | gillistephan/aas-core-codegen | 5b89ea2ee35aecaca9a1bed7ac81d420cc560f29 | [
"MIT"
] | 5 | 2021-12-29T12:55:34.000Z | 2022-03-01T17:57:21.000Z | test_data/parse/unexpected/class_definitions/unexpected_double_description_for_a_property/meta_model.py | gillistephan/aas-core-codegen | 5b89ea2ee35aecaca9a1bed7ac81d420cc560f29 | [
"MIT"
] | 10 | 2021-12-29T02:15:55.000Z | 2022-03-09T11:04:22.000Z | test_data/parse/unexpected/class_definitions/unexpected_double_description_for_a_property/meta_model.py | gillistephan/aas-core-codegen | 5b89ea2ee35aecaca9a1bed7ac81d420cc560f29 | [
"MIT"
] | 2 | 2021-12-29T01:42:12.000Z | 2022-02-15T13:46:33.000Z | class Something:
"""Represent something."""
"""unexpected description"""
some_property: int
"""some property"""
__book_url__ = "dummy"
__book_version__ = "dummy"
| 16.454545 | 32 | 0.657459 | class Something:
some_property: int
__book_url__ = "dummy"
__book_version__ = "dummy"
| true | true |
1c2b1df7891e280c81f4a7da992ea6b335bd7a32 | 3,501 | py | Python | scripts/automation/trex_control_plane/interactive/trex/console/plugins/plugin_bird.py | MassimoGirondi/trex-core | 404f2ce95db249bbf11c959a530f33bb5d10f94c | [
"Apache-2.0"
] | null | null | null | scripts/automation/trex_control_plane/interactive/trex/console/plugins/plugin_bird.py | MassimoGirondi/trex-core | 404f2ce95db249bbf11c959a530f33bb5d10f94c | [
"Apache-2.0"
] | null | null | null | scripts/automation/trex_control_plane/interactive/trex/console/plugins/plugin_bird.py | MassimoGirondi/trex-core | 404f2ce95db249bbf11c959a530f33bb5d10f94c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
from trex.console.plugins import *
from trex.stl.api import *
from trex.pybird.bird_cfg_creator import *
from trex.pybird.bird_zmq_client import *
'''
Bird plugin
'''
class Bird_Plugin(ConsolePlugin):
def plugin_description(self):
return 'Bird plugin for simple communication with PyBird... | 37.645161 | 102 | 0.52585 |
from trex.console.plugins import *
from trex.stl.api import *
from trex.pybird.bird_cfg_creator import *
from trex.pybird.bird_zmq_client import *
class Bird_Plugin(ConsolePlugin):
def plugin_description(self):
return 'Bird plugin for simple communication with PyBirdserver'
def plugin_load(self):
... | true | true |
1c2b1e7e48eede273a5b9885d4ebbc36fdb68f2b | 1,004 | py | Python | launch/link-intersection-brute-force.py | balazs-bamer/link-intersection-brute-force | 1098d5555ebaa9c23c326f75c493b855199ff6bf | [
"MIT"
] | 1 | 2021-04-27T10:40:50.000Z | 2021-04-27T10:40:50.000Z | launch/link-intersection-brute-force.py | balazs-bamer/link-intersection-brute-force | 1098d5555ebaa9c23c326f75c493b855199ff6bf | [
"MIT"
] | 1 | 2021-04-27T16:05:38.000Z | 2021-04-28T11:52:39.000Z | launch/link-intersection-brute-force.py | balazs-bamer/link-intersection-brute-force | 1098d5555ebaa9c23c326f75c493b855199ff6bf | [
"MIT"
] | null | null | null | import os
from launch import LaunchDescription
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
def generate_launch_descripti... | 34.62069 | 135 | 0.77988 | import os
from launch import LaunchDescription
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
def generate_launch_descripti... | true | true |
1c2b1ea4f2fc78cf05b77d8b3ecf42626a31e9a5 | 2,161 | py | Python | monarch/s3.py | LaurEars/monarch | 0554df50edab6ccb67480038b8db72197d36783a | [
"MIT"
] | null | null | null | monarch/s3.py | LaurEars/monarch | 0554df50edab6ccb67480038b8db72197d36783a | [
"MIT"
] | null | null | null | monarch/s3.py | LaurEars/monarch | 0554df50edab6ccb67480038b8db72197d36783a | [
"MIT"
] | null | null | null | import os
from datetime import datetime
# 3rd Party Imports
import boto
from boto.s3.key import Key
from click import echo
from .utils import temp_directory, zipdir
from .local import local_restore
from .mongo import dump_db
def get_s3_bucket(s3_settings):
conn = boto.connect_s3(s3_settings['aws_access_key_id']... | 26.353659 | 98 | 0.654327 | import os
from datetime import datetime
import boto
from boto.s3.key import Key
from click import echo
from .utils import temp_directory, zipdir
from .local import local_restore
from .mongo import dump_db
def get_s3_bucket(s3_settings):
conn = boto.connect_s3(s3_settings['aws_access_key_id'], s3_settings['aws_... | true | true |
1c2b1f78a9f0d57e00fbd23e8fd849fef5b60c1f | 3,062 | py | Python | gqp_mc/fm.py | changhoonhahn/GQP_mock_challenge | 831d5423edd9955ee1bda8d41e44d30cd3c6bd4b | [
"MIT"
] | 3 | 2019-12-18T20:51:45.000Z | 2021-12-11T05:59:24.000Z | gqp_mc/fm.py | changhoonhahn/GQP_mock_challenge | 831d5423edd9955ee1bda8d41e44d30cd3c6bd4b | [
"MIT"
] | 44 | 2020-02-20T06:02:00.000Z | 2021-04-13T20:00:50.000Z | gqp_mc/fm.py | changhoonhahn/GQP_mock_challenge | 831d5423edd9955ee1bda8d41e44d30cd3c6bd4b | [
"MIT"
] | 7 | 2019-10-04T22:25:44.000Z | 2020-07-20T02:05:03.000Z | '''
submodule for forward modeling spectrophotometry
'''
import os
import numpy as np
from speclite import filters as specFilter
def Photo_DESI(wave, spectra, bands=['g', 'r', 'z']):
''' generate photometry by convolving the input spectrum with DECAM and WISE
bandpasses: g, r, z, W1, W2, W3, W4 filte... | 34.795455 | 109 | 0.621489 | import os
import numpy as np
from speclite import filters as specFilter
def Photo_DESI(wave, spectra, bands=['g', 'r', 'z']):
wave = np.atleast_2d(wave)
assert wave.shape[1] == spectra.shape[1]
n_spec = spectra.shape[0]
if wave.shape[0] == 1: wave = np.tile(wave, (n_spec, 1))
from astropy i... | true | true |
1c2b1fbfb14ddd021cc54211238b66fa242fea79 | 14,369 | py | Python | cfgov/v1/migrations/0219_move_directors_notebook.py | flacoman91/consumerfinance.gov | 64e3d68d1c023ae944baf66a99e54236e5976097 | [
"CC0-1.0"
] | 37 | 2020-08-18T19:52:39.000Z | 2022-03-23T08:08:41.000Z | cfgov/v1/migrations/0219_move_directors_notebook.py | flacoman91/consumerfinance.gov | 64e3d68d1c023ae944baf66a99e54236e5976097 | [
"CC0-1.0"
] | 338 | 2020-08-14T20:46:36.000Z | 2022-03-31T20:49:32.000Z | cfgov/v1/migrations/0219_move_directors_notebook.py | raft-tech/cfgov-refresh | 7c63c31fd6bb95ed4f7d368f1e1252175f0c71ca | [
"CC0-1.0"
] | 14 | 2020-10-21T15:27:03.000Z | 2022-03-17T03:16:36.000Z | # Generated by Django 2.2.12 on 2020-06-02 16:41
from django.db import migrations, models
import v1.atomic_elements.molecules
import v1.blocks
import v1.models.snippets
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
import wagtail.snippets.blocks
class Migration(migrations.Migrati... | 399.138889 | 7,782 | 0.737351 |
from django.db import migrations, models
import v1.atomic_elements.molecules
import v1.blocks
import v1.models.snippets
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
import wagtail.snippets.blocks
class Migration(migrations.Migration):
dependencies = [
('v1', '0218_... | true | true |
1c2b20126cfa1deb4d78e265e26c98ff9951782a | 1,369 | py | Python | ooobuild/dyn/frame/x_layout_manager2.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/frame/x_layout_manager2.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/frame/x_layout_manager2.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 37 | 85 | 0.769905 |
from typing import TYPE_CHECKING
from ooo.oenv.env_const import UNO_ENVIRONMENT, UNO_RUNTIME
_DYNAMIC = False
if (not TYPE_CHECKING) and UNO_RUNTIME and UNO_ENVIRONMENT:
_DYNAMIC = True
if not TYPE_CHECKING and _DYNAMIC:
from com.sun.star.frame import XLayoutManager2 as XLayoutManager2
... | true | true |
1c2b22346e3ef10d78afbd239821aac46d72fd58 | 711 | py | Python | main/service/type_service.py | emhayusa/4d_api | cbf380c150d6f7a01954346492fe9a7751a6603b | [
"MIT"
] | null | null | null | main/service/type_service.py | emhayusa/4d_api | cbf380c150d6f7a01954346492fe9a7751a6603b | [
"MIT"
] | null | null | null | main/service/type_service.py | emhayusa/4d_api | cbf380c150d6f7a01954346492fe9a7751a6603b | [
"MIT"
] | null | null | null | import uuid
import datetime
from app.main import db
from app.main.model.type import Type
def save_new(data):
row = Type.query.filter_by(type_name=data['type_name']).first()
if not row:
new = Type(
type_name=data['type_name'],
)
save_changes(new)
response_object = {
'status': 'success',
'message': '... | 20.911765 | 64 | 0.673699 | import uuid
import datetime
from app.main import db
from app.main.model.type import Type
def save_new(data):
row = Type.query.filter_by(type_name=data['type_name']).first()
if not row:
new = Type(
type_name=data['type_name'],
)
save_changes(new)
response_object = {
'status': 'success',
'message': '... | true | true |
1c2b22572104c711e6f9f2ddfd62d842121e2ebe | 261 | py | Python | config.py | Mainakkundu/titanic-gcp-kubernet | d3d0cc9969f237aada4572ef8e627eb3aafb5fc9 | [
"MIT"
] | 6 | 2020-11-26T23:14:36.000Z | 2021-04-16T03:21:34.000Z | config.py | Mainakkundu/titanic-gcp-kubernet | d3d0cc9969f237aada4572ef8e627eb3aafb5fc9 | [
"MIT"
] | 5 | 2020-04-22T01:58:38.000Z | 2022-03-12T00:23:40.000Z | config.py | Mainakkundu/titanic-gcp-kubernet | d3d0cc9969f237aada4572ef8e627eb3aafb5fc9 | [
"MIT"
] | null | null | null | from os import environ as env
import multiprocessing
PORT = int(env.get("PORT", 8080))
DEBUG_MODE = int(env.get("DEBUG_MODE", 1))
# Gunicorn config
bind = ":" + str(PORT)
workers = multiprocessing.cpu_count() * 2 + 1
threads = 2 * multiprocessing.cpu_count()
| 23.727273 | 45 | 0.712644 | from os import environ as env
import multiprocessing
PORT = int(env.get("PORT", 8080))
DEBUG_MODE = int(env.get("DEBUG_MODE", 1))
bind = ":" + str(PORT)
workers = multiprocessing.cpu_count() * 2 + 1
threads = 2 * multiprocessing.cpu_count()
| true | true |
1c2b22c206bc71ab4eeddd556a1edcdc75ff2aa4 | 10,120 | py | Python | application/games/crosswordcreator/data/board.py | Tyler-Yates/game-box | dc838270c3777372c3eeaf1e09fb1962c36fc2a8 | [
"MIT"
] | 1 | 2020-12-13T02:41:19.000Z | 2020-12-13T02:41:19.000Z | application/games/crosswordcreator/data/board.py | Tyler-Yates/game-box | dc838270c3777372c3eeaf1e09fb1962c36fc2a8 | [
"MIT"
] | null | null | null | application/games/crosswordcreator/data/board.py | Tyler-Yates/game-box | dc838270c3777372c3eeaf1e09fb1962c36fc2a8 | [
"MIT"
] | null | null | null | from typing import List, Optional, Tuple, Set, Dict
from ...common.word_manager import WordManager
class Board:
"""
Represents a board for a single player.
Boards are assumed to be square (equal number of rows and columns).
The board is represented as a two dimensional matrix.
Points on the boar... | 37.902622 | 118 | 0.573221 | from typing import List, Optional, Tuple, Set, Dict
from ...common.word_manager import WordManager
class Board:
def __init__(self, player_id: str, board_size: int, word_manager: WordManager):
self.player_id = player_id
self.board_size = board_size
self.board: List[List[Optional[str]]] = ... | true | true |
1c2b236d2d55b6a39af3ed7fa660f24bc4e4454c | 18,818 | py | Python | log_complete/model_390.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_390.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_390.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 91.349515 | 710 | 0.806515 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', ... | true | true |
1c2b26105539ec751d049b502c83a687b11e6631 | 1,062 | py | Python | gmm_code/plot_var_vs_clip.py | DPBayes/DP-MCMC-NeurIPS2019 | bf5349835b2044135749ea6dbedea2e310d7d2f2 | [
"MIT"
] | 1 | 2021-06-29T00:35:10.000Z | 2021-06-29T00:35:10.000Z | gmm_code/plot_var_vs_clip.py | DPBayes/DP-MCMC-NeurIPS2019 | bf5349835b2044135749ea6dbedea2e310d7d2f2 | [
"MIT"
] | null | null | null | gmm_code/plot_var_vs_clip.py | DPBayes/DP-MCMC-NeurIPS2019 | bf5349835b2044135749ea6dbedea2e310d7d2f2 | [
"MIT"
] | 1 | 2021-06-29T00:35:14.000Z | 2021-06-29T00:35:14.000Z | import numpy as np
import pickle
import matplotlib.pyplot as plt
from plot_path import path
def plot_fig3(fname):
fontsize = 25
figsize = (8.5,6)
temped_results = pickle.load(open(fname, 'rb'))
temped_dp_mcmc_params = temped_results[0]
temped_chain = temped_results[1]
temped_privacy_params = temped_results[2]
... | 36.62069 | 91 | 0.76177 | import numpy as np
import pickle
import matplotlib.pyplot as plt
from plot_path import path
def plot_fig3(fname):
fontsize = 25
figsize = (8.5,6)
temped_results = pickle.load(open(fname, 'rb'))
temped_dp_mcmc_params = temped_results[0]
temped_chain = temped_results[1]
temped_privacy_params = temped_results[2]
... | true | true |
1c2b2692ef1f831acee54c7ccdf84e973f1db901 | 2,579 | py | Python | iot_control/app.py | DDizzzy79/ScienceFair | b41c96f74ab7e1db752e9985a740130ee1abeb1f | [
"MIT"
] | 1 | 2021-12-01T15:12:59.000Z | 2021-12-01T15:12:59.000Z | iot_control/app.py | DDizzzy79/ScienceFair | b41c96f74ab7e1db752e9985a740130ee1abeb1f | [
"MIT"
] | null | null | null | iot_control/app.py | DDizzzy79/ScienceFair | b41c96f74ab7e1db752e9985a740130ee1abeb1f | [
"MIT"
] | null | null | null | from flask import Flask,render_template
import RPi.GPIO as GPIO
import time
import lcd1602 as lcd
import time
from luma.led_matrix.device import *
from luma.core.interface.serial import spi, noop
from luma.core.render import canvas
from luma.core.legacy import text
serial = spi(port=0, device=0, gpio=noop())
device = m... | 27.43617 | 116 | 0.597131 | from flask import Flask,render_template
import RPi.GPIO as GPIO
import time
import lcd1602 as lcd
import time
from luma.led_matrix.device import *
from luma.core.interface.serial import spi, noop
from luma.core.render import canvas
from luma.core.legacy import text
serial = spi(port=0, device=0, gpio=noop())
device = m... | true | true |
1c2b26e248bcb6fc179ce066242c7221429578e8 | 726 | py | Python | touchdown/aws/kms/__init__.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 14 | 2015-01-05T18:18:04.000Z | 2022-02-07T19:35:12.000Z | touchdown/aws/kms/__init__.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 106 | 2015-01-06T00:17:13.000Z | 2019-09-07T00:35:32.000Z | touchdown/aws/kms/__init__.py | yaybu/touchdown | 70ecda5191ce2d095bc074dcb23bfa1584464814 | [
"Apache-2.0"
] | 5 | 2015-01-30T10:18:24.000Z | 2022-02-07T19:35:13.000Z | # Copyright 2015 Isotoma Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 34.571429 | 74 | 0.757576 |
from .alias import Alias
from .grant import Grant
from .key import Key
from .wrapper import Wrapper
__all__ = ["Alias", "Grant", "Key", "Wrapper"]
| true | true |
1c2b28b316b72deb738bf4f5837b485b63c49ba7 | 490 | py | Python | fairseq/__init__.py | beichao1314/fairseq | b1521f962e4ca670311c0cd0c8b1dadf310cb242 | [
"BSD-3-Clause"
] | 140 | 2019-06-10T04:02:07.000Z | 2022-03-22T11:08:27.000Z | fairseq/__init__.py | beichao1314/fairseq | b1521f962e4ca670311c0cd0c8b1dadf310cb242 | [
"BSD-3-Clause"
] | 7 | 2019-04-24T09:07:06.000Z | 2022-03-28T21:58:04.000Z | fairseq/__init__.py | beichao1314/fairseq | b1521f962e4ca670311c0cd0c8b1dadf310cb242 | [
"BSD-3-Clause"
] | 11 | 2019-06-21T05:31:17.000Z | 2022-01-04T02:20:46.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from .multiprocessing_pdb import p... | 27.222222 | 78 | 0.791837 |
from .multiprocessing_pdb import pdb
__all__ = ['pdb']
import fairseq.criterions
import fairseq.models
import fairseq.modules
import fairseq.optim
import fairseq.optim.lr_scheduler
import fairseq.tasks
| true | true |
1c2b29ee506620ebaf32b44c7796a7ef747c0674 | 31 | py | Python | learn.py | ishmandoo/FlapPyBird-Neural | 2cd733db090dd972e698a5d951b90f76f091babe | [
"MIT"
] | 2 | 2019-11-13T22:14:30.000Z | 2019-11-13T22:15:24.000Z | learn.py | ishmandoo/FlapPyBird | 2cd733db090dd972e698a5d951b90f76f091babe | [
"MIT"
] | null | null | null | learn.py | ishmandoo/FlapPyBird | 2cd733db090dd972e698a5d951b90f76f091babe | [
"MIT"
] | null | null | null | from flappy import main
main() | 10.333333 | 23 | 0.774194 | from flappy import main
main() | true | true |
1c2b2a1bbaf27d3f3d13070304854ad20431ba7a | 2,517 | py | Python | convert.py | vkhurana/calibre-convert | 7ae6cf4ca5c40386131a5a32a40e0bd68ecf77ce | [
"MIT"
] | null | null | null | convert.py | vkhurana/calibre-convert | 7ae6cf4ca5c40386131a5a32a40e0bd68ecf77ce | [
"MIT"
] | null | null | null | convert.py | vkhurana/calibre-convert | 7ae6cf4ca5c40386131a5a32a40e0bd68ecf77ce | [
"MIT"
] | null | null | null | import time
import subprocess
import os
import sys
import pyinotify
from os.path import exists
from pyinotify import WatchManager, Notifier, ProcessEvent, EventsCodes
def Monitor(path):
class PClose(ProcessEvent):
temp_folder = "temp"
def process_IN_CLOSE(self, event):
src_f... | 37.014706 | 95 | 0.528804 | import time
import subprocess
import os
import sys
import pyinotify
from os.path import exists
from pyinotify import WatchManager, Notifier, ProcessEvent, EventsCodes
def Monitor(path):
class PClose(ProcessEvent):
temp_folder = "temp"
def process_IN_CLOSE(self, event):
src_f... | true | true |
1c2b2a7cd5acfc7949b666466fb33ee224cd6528 | 2,889 | py | Python | genlog/helper.py | ilpan/GenerateLog | 1cc9779870473e21e6b42112b17489c59792d5c1 | [
"MIT"
] | null | null | null | genlog/helper.py | ilpan/GenerateLog | 1cc9779870473e21e6b42112b17489c59792d5c1 | [
"MIT"
] | null | null | null | genlog/helper.py | ilpan/GenerateLog | 1cc9779870473e21e6b42112b17489c59792d5c1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author : ilpan
@contact : pna.dev@outlook.com
@file : helper.py
@desc :
1)指定造数据的 client 的个数
2)指定 client 造数据的时间间隔(秒)
3)指定需要收集的用户最大数目
4)指定 flume 的 host:port
@time : 18-3-18 下午12:10
"""
import argparse
import sys
... | 30.09375 | 119 | 0.581862 |
import argparse
import sys
from genlog import __description__, __version__
from genlog.exception import *
class Helper:
def __init__(self):
self._client_num = 100
self._interval = 0
self._user_num = 10000
self._remote_host_list = []
self._show = False
def help(sel... | true | true |
1c2b2ac70dc685491a57826d0eb2dc253498f493 | 3,852 | py | Python | GRNetDetector/utils/metrics.py | 565353780/gr-net | 7dedb326bd5f8e12e0f8aa39e1c728fe68f26f4f | [
"MIT"
] | null | null | null | GRNetDetector/utils/metrics.py | 565353780/gr-net | 7dedb326bd5f8e12e0f8aa39e1c728fe68f26f4f | [
"MIT"
] | null | null | null | GRNetDetector/utils/metrics.py | 565353780/gr-net | 7dedb326bd5f8e12e0f8aa39e1c728fe68f26f4f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author: Haozhe Xie
# @Date: 2019-08-08 14:31:30
# @Last Modified by: Haozhe Xie
# @Last Modified time: 2020-05-25 09:13:32
# @Email: cshzxie@gmail.com
import logging
import open3d
from GRNetDetector.extensions.chamfer_dist import ChamferDistance
class Metrics(object):
ITEMS = [{
... | 31.317073 | 93 | 0.58541 |
import logging
import open3d
from GRNetDetector.extensions.chamfer_dist import ChamferDistance
class Metrics(object):
ITEMS = [{
'name': 'F-Score',
'enabled': True,
'eval_func': 'cls._get_f_score',
'is_greater_better': True,
'init_value': 0
}, {
'name': ... | true | true |
1c2b2b4f373264cdeee202bfa427475f8fd2cdf8 | 12,601 | py | Python | espresso/speech_train.py | beat-buesser/espresso | bd6ba1f7745c90a2c3c8ff0a0d7332efeebcc808 | [
"MIT"
] | 1 | 2021-01-08T02:51:16.000Z | 2021-01-08T02:51:16.000Z | espresso/speech_train.py | beat-buesser/espresso | bd6ba1f7745c90a2c3c8ff0a0d7332efeebcc808 | [
"MIT"
] | null | null | null | espresso/speech_train.py | beat-buesser/espresso | bd6ba1f7745c90a2c3c8ff0a0d7332efeebcc808 | [
"MIT"
] | 1 | 2021-09-10T15:35:58.000Z | 2021-09-10T15:35:58.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) Yiming Wang
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Train a new model on one or across multiple GPUs.
"""
import logging
import math
import... | 33.96496 | 93 | 0.660821 |
import logging
import math
import os
import sys
import numpy as np
import torch
from fairseq import (
checkpoint_utils,
distributed_utils,
options,
quantization_utils,
tasks,
utils,
)
from fairseq.data import iterators
from fairseq.logging import meters, metrics, progress_bar
from fairse... | true | true |
1c2b2b6e112085f3589e4822c5885ce013b1bc21 | 2,518 | py | Python | object_tracking.py | UAVs-at-Berkeley/flywave | 483012ab34af5b465ecb8750ade9b9e7a2ca5c4e | [
"MIT"
] | 6 | 2018-05-02T15:34:23.000Z | 2021-04-13T19:28:13.000Z | object_tracking.py | UAVs-at-Berkeley/flywave | 483012ab34af5b465ecb8750ade9b9e7a2ca5c4e | [
"MIT"
] | 1 | 2018-04-19T16:11:33.000Z | 2018-05-02T22:53:07.000Z | object_tracking.py | UAVs-at-Berkeley/flywave | 483012ab34af5b465ecb8750ade9b9e7a2ca5c4e | [
"MIT"
] | 7 | 2018-04-19T01:59:03.000Z | 2022-01-02T13:18:26.000Z | """
Demo of the Bebop vision code (basically flies around and saves out photos as it flies)
"""
from Bebop import Bebop
from DroneVision import DroneVision
import threading
import cv2
import time
isAlive = False
class UserVision:
def __init__(self, vision):
self.index = 0
self.vision = vision
... | 31.873418 | 93 | 0.651708 | from Bebop import Bebop
from DroneVision import DroneVision
import threading
import cv2
import time
isAlive = False
class UserVision:
def __init__(self, vision):
self.index = 0
self.vision = vision
def save_pictures(self, args):
img = self.vision.get_latest_valid_picture()
... | true | true |
1c2b2c18b70a298c667528f485ac2535fef0d885 | 853 | py | Python | src/config/configs_parser.py | changleibox/flutter_build_script | a93a7d9ce276b68c3a2d34b5830a4fc9683e574b | [
"Apache-2.0"
] | null | null | null | src/config/configs_parser.py | changleibox/flutter_build_script | a93a7d9ce276b68c3a2d34b5830a4fc9683e574b | [
"Apache-2.0"
] | null | null | null | src/config/configs_parser.py | changleibox/flutter_build_script | a93a7d9ce276b68c3a2d34b5830a4fc9683e574b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2020 CHANGLEI. All rights reserved.
# Created by changlei on 2020/6/30.
import json
import os
import yaml
from src.system import Paths
def __resolve_configs_file():
with open(Paths.config_path, 'r', encoding='utf-8') as f:
return yaml.safe_... | 23.694444 | 80 | 0.62837 |
import json
import os
import yaml
from src.system import Paths
def __resolve_configs_file():
with open(Paths.config_path, 'r', encoding='utf-8') as f:
return yaml.safe_load(f)
def __create_config_file():
with open(Paths.config_path, 'w', encoding='utf-8') as f, \
open(Paths.config... | true | true |
1c2b2cac081ab4554009e172551ff7f519612cde | 1,119 | py | Python | Code/skipthoughts/skipthoughts_dir/training/vocab.py | mattaq31/recognition-forge | c5a6e36d2e81a66ad8c7eb2f108b6821610a7ba9 | [
"BSD-2-Clause"
] | null | null | null | Code/skipthoughts/skipthoughts_dir/training/vocab.py | mattaq31/recognition-forge | c5a6e36d2e81a66ad8c7eb2f108b6821610a7ba9 | [
"BSD-2-Clause"
] | null | null | null | Code/skipthoughts/skipthoughts_dir/training/vocab.py | mattaq31/recognition-forge | c5a6e36d2e81a66ad8c7eb2f108b6821610a7ba9 | [
"BSD-2-Clause"
] | 1 | 2019-06-25T11:40:57.000Z | 2019-06-25T11:40:57.000Z | """
Constructing and loading dictionaries
"""
import _pickle as pkl
import numpy
from collections import OrderedDict
def build_dictionary(text):
"""
Build a dictionary
text: list of sentences (pre-tokenized)
"""
wordcount = OrderedDict()
for cc in text:
words = cc.split()
for w ... | 23.808511 | 81 | 0.613047 | import _pickle as pkl
import numpy
from collections import OrderedDict
def build_dictionary(text):
wordcount = OrderedDict()
for cc in text:
words = cc.split()
for w in words:
if w not in wordcount:
wordcount[w] = 0
wordcount[w] += 1
words = list(word... | true | true |
1c2b2cc3484323921bb899b5611005bf15da3919 | 729 | py | Python | tree/bottom_view_of_a_binary_tree/bottom_view.py | chrisjdavie/compsci_basics | dab0d377c6cf040ddda2c9c9f8373e996b1a594c | [
"MIT"
] | null | null | null | tree/bottom_view_of_a_binary_tree/bottom_view.py | chrisjdavie/compsci_basics | dab0d377c6cf040ddda2c9c9f8373e996b1a594c | [
"MIT"
] | null | null | null | tree/bottom_view_of_a_binary_tree/bottom_view.py | chrisjdavie/compsci_basics | dab0d377c6cf040ddda2c9c9f8373e996b1a594c | [
"MIT"
] | null | null | null | class BottomViewData:
"""List functionality using a negative indexed list.
An over-complicated way of avoiding sorting, to keep the algo to O(N)"""
def __init__(self, len_data):
self._len_data = len_data
self._data = [None]*(2*len_data-1)
def _key_zeroed(self, key):
return se... | 31.695652 | 77 | 0.647462 | class BottomViewData:
def __init__(self, len_data):
self._len_data = len_data
self._data = [None]*(2*len_data-1)
def _key_zeroed(self, key):
return self._len_data-1+key
def __setitem__(self, key, depth_val):
key_z = self._key_zeroed(key)
if self._data[key_z] is Non... | true | true |
1c2b2d87b02fa9fbc37371aba75d8666759ee1b5 | 786 | py | Python | discussion/urls.py | Bruskoo/PublicDiscussion | f3e9cba88fc48078ac3570a6f562dcad7612ef0a | [
"MIT"
] | null | null | null | discussion/urls.py | Bruskoo/PublicDiscussion | f3e9cba88fc48078ac3570a6f562dcad7612ef0a | [
"MIT"
] | null | null | null | discussion/urls.py | Bruskoo/PublicDiscussion | f3e9cba88fc48078ac3570a6f562dcad7612ef0a | [
"MIT"
] | null | null | null | from django.urls import path
from .views import (
ArticleCreateView,
ArticleDeleteView,
ArticleListView,
# CommentCreateView,
ArticleUpdateView,
SearchView,
ArticleDetailView
)
urlpatterns = [
path("article/add/", ArticleCreateView.as_view(), name="article-create"),
path("article/<i... | 39.3 | 93 | 0.697201 | from django.urls import path
from .views import (
ArticleCreateView,
ArticleDeleteView,
ArticleListView,
ArticleUpdateView,
SearchView,
ArticleDetailView
)
urlpatterns = [
path("article/add/", ArticleCreateView.as_view(), name="article-create"),
path("article/<int:pk>/", ArticleDet... | true | true |
1c2b2da8382be12f3d6521d7c9eb17eee7eb103f | 27,208 | py | Python | pydantic/types.py | bluetech/pydantic | b7a8ef25c667b5dd4c4cd0b109c6625d1a57139a | [
"MIT"
] | null | null | null | pydantic/types.py | bluetech/pydantic | b7a8ef25c667b5dd4c4cd0b109c6625d1a57139a | [
"MIT"
] | null | null | null | pydantic/types.py | bluetech/pydantic | b7a8ef25c667b5dd4c4cd0b109c6625d1a57139a | [
"MIT"
] | null | null | null | import math
import re
import warnings
from decimal import Decimal
from enum import Enum
from pathlib import Path
from types import new_class
from typing import (
TYPE_CHECKING,
Any,
Callable,
ClassVar,
Dict,
List,
Optional,
Pattern,
Set,
Tuple,
Type,
TypeVar,
Union,
... | 29.006397 | 120 | 0.641392 | import math
import re
import warnings
from decimal import Decimal
from enum import Enum
from pathlib import Path
from types import new_class
from typing import (
TYPE_CHECKING,
Any,
Callable,
ClassVar,
Dict,
List,
Optional,
Pattern,
Set,
Tuple,
Type,
TypeVar,
Union,
... | true | true |
1c2b2dcba360df8497d5ba43d575b2ba81dcabef | 2,790 | py | Python | networks/unet.py | songpeng326/pytorch-semantic-segmentation | 366259cbc3220744c3a633766075f1d06b1c0b3f | [
"MIT"
] | 88 | 2018-04-04T11:02:55.000Z | 2022-01-04T16:32:54.000Z | networks/unet.py | ZhenhLi/pytorch-semantic-segmentation | 7469de95cdb0fbfe9b00b93a8b068c35d398c6cf | [
"MIT"
] | 8 | 2018-04-09T07:52:35.000Z | 2019-04-12T07:35:23.000Z | networks/unet.py | ZhenhLi/pytorch-semantic-segmentation | 7469de95cdb0fbfe9b00b93a8b068c35d398c6cf | [
"MIT"
] | 32 | 2018-05-30T04:05:05.000Z | 2021-04-22T15:45:56.000Z | import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from torch.utils import model_zoo
from torchvision import models
class UNetEnc(nn.Module):
def __init__(self, in_channels, features, out_channels):
super().__init__()
self.up = nn.Sequential(
... | 30 | 70 | 0.558781 | import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from torch.utils import model_zoo
from torchvision import models
class UNetEnc(nn.Module):
def __init__(self, in_channels, features, out_channels):
super().__init__()
self.up = nn.Sequential(
... | true | true |
1c2b2e18eb5e04cc32cc54e6818b65ee64684e89 | 909 | py | Python | regulation/debug.py | pierrehebert/photovoltaic_optimizer | 5c20d2fccabc2e3e8a7c471a2e83a6061a8fd235 | [
"Apache-2.0"
] | 2 | 2020-04-15T12:02:16.000Z | 2020-05-18T02:13:46.000Z | regulation/debug.py | pierrehebert/photovoltaic_optimizer | 5c20d2fccabc2e3e8a7c471a2e83a6061a8fd235 | [
"Apache-2.0"
] | null | null | null | regulation/debug.py | pierrehebert/photovoltaic_optimizer | 5c20d2fccabc2e3e8a7c471a2e83a6061a8fd235 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018-2019 Pierre Hébert
#
# 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 ... | 32.464286 | 74 | 0.754675 |
import logging
logger = logging.getLogger('power_regulation')
logger.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)
def debug(indent, msg):
logger.info((' '*in... | true | true |
1c2b2e96e15eac01204fe0230ea6ab7b6887d64f | 8,028 | py | Python | main.py | comp5331-Xtimeseries/mWDN | 3805f90230b93d04f86201079358ec1f6dd6bb2d | [
"MIT"
] | null | null | null | main.py | comp5331-Xtimeseries/mWDN | 3805f90230b93d04f86201079358ec1f6dd6bb2d | [
"MIT"
] | null | null | null | main.py | comp5331-Xtimeseries/mWDN | 3805f90230b93d04f86201079358ec1f6dd6bb2d | [
"MIT"
] | null | null | null | import argparse
import math
import time
import torch
import torch.nn as nn
from models import LSTNet
from models.mWDN import mWDN
# from tsai.models import mWDN
import numpy as np;
import importlib
import Datasets
from utils import *;
import Optim
def evaluate(data, X, Y, model, evaluateL2, evaluateL1, batch_size):
... | 38.228571 | 226 | 0.643 | import argparse
import math
import time
import torch
import torch.nn as nn
from models import LSTNet
from models.mWDN import mWDN
import numpy as np;
import importlib
import Datasets
from utils import *;
import Optim
def evaluate(data, X, Y, model, evaluateL2, evaluateL1, batch_size):
model.eval();
total_los... | true | true |
1c2b2eacd034df49e2f4737731a48a56bfa4e8af | 1,571 | py | Python | tools/Polygraphy/polygraphy/config.py | hwkyai/TensorRT | d04182cd0086c70db4a8ad30e0d7675c4eb33782 | [
"Apache-2.0"
] | null | null | null | tools/Polygraphy/polygraphy/config.py | hwkyai/TensorRT | d04182cd0086c70db4a8ad30e0d7675c4eb33782 | [
"Apache-2.0"
] | null | null | null | tools/Polygraphy/polygraphy/config.py | hwkyai/TensorRT | d04182cd0086c70db4a8ad30e0d7675c4eb33782 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appl... | 41.342105 | 109 | 0.782304 |
import os
INTERNAL_CORRECTNESS_CHECKS = bool(os.environ.get("POLYGRAPHY_INTERNAL_CORRECTNESS_CHECKS", "0") != "0")
AUTOINSTALL_DEPS = bool(os.environ.get("POLYGRAPHY_AUTOINSTALL_DEPS", "0") != "0")
ARRAY_SWAP_THRESHOLD_MB = int(os.environ.get("POLYGRAPHY_ARRAY_SWAP_THRESHOLD_MB", "-1"))
| true | true |
1c2b2f0ce5b70b75b13a6cbbbbe690ee0279af9c | 708 | py | Python | defining_classes/6_flower.py | Minkov/python-oop-2020-06 | 63b830a42b7abfac5bee576a81ee7626c47a80bc | [
"MIT"
] | 3 | 2020-07-04T11:32:42.000Z | 2020-08-14T08:43:25.000Z | defining_classes/6_flower.py | Minkov/python-oop-2020-06 | 63b830a42b7abfac5bee576a81ee7626c47a80bc | [
"MIT"
] | null | null | null | defining_classes/6_flower.py | Minkov/python-oop-2020-06 | 63b830a42b7abfac5bee576a81ee7626c47a80bc | [
"MIT"
] | 2 | 2020-07-09T07:17:37.000Z | 2021-02-22T22:55:52.000Z | class Flower:
def __init__(self, name, water_requirements):
self.name = name
self.water_requirements = water_requirements
self.current_water = 0
self.is_happy = False
def water(self, quantity):
self.current_water += quantity
self.is_happy = self.get_happ... | 26.222222 | 61 | 0.620056 | class Flower:
def __init__(self, name, water_requirements):
self.name = name
self.water_requirements = water_requirements
self.current_water = 0
self.is_happy = False
def water(self, quantity):
self.current_water += quantity
self.is_happy = self.get_happ... | true | true |
1c2b2f67485747ddf6766f04c0cc97347b89b0ef | 10,985 | py | Python | hyperlib/manifold/poincare.py | sourface94/hyperlib | 2353475a843070588a9faf62f075cb6c75082e48 | [
"MIT"
] | null | null | null | hyperlib/manifold/poincare.py | sourface94/hyperlib | 2353475a843070588a9faf62f075cb6c75082e48 | [
"MIT"
] | null | null | null | hyperlib/manifold/poincare.py | sourface94/hyperlib | 2353475a843070588a9faf62f075cb6c75082e48 | [
"MIT"
] | null | null | null | import tensorflow as tf
from .base import Manifold
from ..utils.math import tanh, atanh_
class Poincare(Manifold):
"""
Implementation of the poincare manifold,. This class can be used for mathematical functions on the poincare manifold.
"""
def __init__(self,):
super(Poincare, self).__init__... | 36.374172 | 121 | 0.558398 | import tensorflow as tf
from .base import Manifold
from ..utils.math import tanh, atanh_
class Poincare(Manifold):
def __init__(self,):
super(Poincare, self).__init__()
self.name = "Poincare"
self.min_norm = 1e-15
self.eps = {tf.float32: 4e-3, tf.float64: 1e-5}
self.k = 1... | true | true |
1c2b2f742468695c7088ead48076b290d5274a1a | 8,268 | py | Python | conoha/api/network.py | ttk1/conoha-cli | d1c68ee63e9c61a0a727a24206a1fd8aa4abcf13 | [
"MIT"
] | null | null | null | conoha/api/network.py | ttk1/conoha-cli | d1c68ee63e9c61a0a727a24206a1fd8aa4abcf13 | [
"MIT"
] | null | null | null | conoha/api/network.py | ttk1/conoha-cli | d1c68ee63e9c61a0a727a24206a1fd8aa4abcf13 | [
"MIT"
] | null | null | null | '''
Network API の呼び出し部分
'''
from conoha import config
from conoha.util import http
endpoint = config.get_config()['endpoint']['network']
def list_networks():
'''
https://www.conoha.jp/docs/neutron-get_networks_list.php
'''
headers = {
'Accept': 'application/json',
'X-Auth-Token': con... | 26.5 | 87 | 0.583454 |
from conoha import config
from conoha.util import http
endpoint = config.get_config()['endpoint']['network']
def list_networks():
headers = {
'Accept': 'application/json',
'X-Auth-Token': config.get_token()['id']
}
return http.get(f'{endpoint}/networks', headers)
def create_network():
... | true | true |
1c2b3275f73874280dbbf256213b60596356c59d | 183 | py | Python | gym_multigrid/envs/__init__.py | n0whereRuoxi/gym-multigrid | 98809bd40b3d4a0bfa1ab909b1a748fe82d71b60 | [
"Apache-2.0"
] | null | null | null | gym_multigrid/envs/__init__.py | n0whereRuoxi/gym-multigrid | 98809bd40b3d4a0bfa1ab909b1a748fe82d71b60 | [
"Apache-2.0"
] | null | null | null | gym_multigrid/envs/__init__.py | n0whereRuoxi/gym-multigrid | 98809bd40b3d4a0bfa1ab909b1a748fe82d71b60 | [
"Apache-2.0"
] | null | null | null | from gym_multigrid.envs.collect_game import CollectGame4HEnv10x10N2
from gym_multigrid.envs.soccer_game import SoccerGame4HEnv10x15N2
from gym_multigrid.envs.doorkey import DoorKeyEnv | 61 | 67 | 0.907104 | from gym_multigrid.envs.collect_game import CollectGame4HEnv10x10N2
from gym_multigrid.envs.soccer_game import SoccerGame4HEnv10x15N2
from gym_multigrid.envs.doorkey import DoorKeyEnv | true | true |
1c2b32fec97d43e768fb54eff2e7f5f1493499f4 | 71 | py | Python | src/fdk_organization_bff/config/__init__.py | Informasjonsforvaltning/organization-page-bffe | 473dc9606649f864618f4f8bfc4a6a2a035f06d7 | [
"Apache-2.0"
] | null | null | null | src/fdk_organization_bff/config/__init__.py | Informasjonsforvaltning/organization-page-bffe | 473dc9606649f864618f4f8bfc4a6a2a035f06d7 | [
"Apache-2.0"
] | 47 | 2020-05-14T07:54:48.000Z | 2022-03-29T22:17:08.000Z | src/fdk_organization_bff/config/__init__.py | Informasjonsforvaltning/organization-page-bffe | 473dc9606649f864618f4f8bfc4a6a2a035f06d7 | [
"Apache-2.0"
] | null | null | null | """Config package.
Modules:
config
"""
from .config import Config
| 10.142857 | 26 | 0.676056 | from .config import Config
| true | true |
1c2b3475de2a1e1297fba8b659a529d7453411fa | 42,050 | py | Python | .mywaflib/waflib/Build.py | tobiasraabe/crypto | 5b40049169cfbf02f4979a55e8abdb77b834b820 | [
"BSD-3-Clause"
] | null | null | null | .mywaflib/waflib/Build.py | tobiasraabe/crypto | 5b40049169cfbf02f4979a55e8abdb77b834b820 | [
"BSD-3-Clause"
] | 1 | 2017-08-31T15:55:24.000Z | 2017-08-31T15:55:24.000Z | .mywaflib/waflib/Build.py | tobiasraabe/crypto | 5b40049169cfbf02f4979a55e8abdb77b834b820 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2016 (ita)
"""
Classes related to the build phase (build, clean, install, step, etc)
The inheritance tree is the following:
"""
import os, sys, errno, re, shutil, stat
try:
import cPickle
except ImportError:
import pickle as cPickle
from waflib import No... | 28.469871 | 158 | 0.682711 |
import os, sys, errno, re, shutil, stat
try:
import cPickle
except ImportError:
import pickle as cPickle
from waflib import Node, Runner, TaskGen, Utils, ConfigSet, Task, Logs, Options, Context, Errors
CACHE_DIR = 'c4che'
CACHE_SUFFIX = '_cache.py'
INSTALL = 1337
UNINSTALL = -1337
SAVED_ATTRS = 'root node_s... | true | true |
1c2b3491c1eb3dd28653acaba916c1f7d1bdac0a | 1,841 | py | Python | var/spack/repos/builtin/packages/py-cmake/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-cmake/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/py-cmake/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PyCmake(PythonPackage):
"""CMake is an open-source, cross-platform family of tools... | 41.840909 | 96 | 0.661597 |
from spack.package import *
class PyCmake(PythonPackage):
homepage = "https://cmake.org"
git = "https://github.com/scikit-build/cmake-python-distributions.git"
pypi = "cmake/cmake-3.22.2.tar.gz"
version('3.22.2', sha256='b5bd5eeb488b13cf64ec963800f3d979eaeb90b4382861b86909df503379e219')
ver... | true | true |
1c2b34a62d85606c90a9cd041550a4133f0739cd | 1,849 | py | Python | setup.py | thomwiggers/httpserver | 88a3a35619ce5185347c6764f211878e898e6aad | [
"BSD-3-Clause"
] | 3 | 2017-03-04T12:47:39.000Z | 2018-05-04T13:44:47.000Z | setup.py | thomwiggers/httpserver | 88a3a35619ce5185347c6764f211878e898e6aad | [
"BSD-3-Clause"
] | null | null | null | setup.py | thomwiggers/httpserver | 88a3a35619ce5185347c6764f211878e898e6aad | [
"BSD-3-Clause"
] | 7 | 2015-03-22T15:05:54.000Z | 2022-02-07T07:02:20.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read().replace('.. :changelog:', ... | 24.653333 | 63 | 0.629529 |
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read().replace('.. :changelog:', '')
class PyTest(TestCommand):
def fin... | true | true |
1c2b34d3bca81235599234099d80fbe425c8eaa7 | 1,319 | py | Python | modular_program.py | Sanjin84/CompetitionInterface | 50ba1c58b874897d1991b6a28816f2424803a0b2 | [
"CC0-1.0"
] | null | null | null | modular_program.py | Sanjin84/CompetitionInterface | 50ba1c58b874897d1991b6a28816f2424803a0b2 | [
"CC0-1.0"
] | null | null | null | modular_program.py | Sanjin84/CompetitionInterface | 50ba1c58b874897d1991b6a28816f2424803a0b2 | [
"CC0-1.0"
] | null | null | null | from tkinter import *
root = Tk()
root.geometry("1000x600")
root.resizable(True,True)
root.title("DASHBOARD")
#CREATE A START PAGE
start = Frame(root,bg='#539bf9', height=600, width=1000)
start.pack()
start_heading = Label(start,text="GLOBAL WATCHTOWER \n SV 21 INTERFACE",font = "Verdana 30 bold",bg="#539bf9")
sta... | 39.969697 | 125 | 0.714936 | from tkinter import *
root = Tk()
root.geometry("1000x600")
root.resizable(True,True)
root.title("DASHBOARD")
start = Frame(root,bg='#539bf9', height=600, width=1000)
start.pack()
start_heading = Label(start,text="GLOBAL WATCHTOWER \n SV 21 INTERFACE",font = "Verdana 30 bold",bg="#539bf9")
start_heading.place(rel... | true | true |
1c2b35533c323ec4950a6b63a97c10d9551b6a66 | 501 | py | Python | orders/serializers/orderserializer.py | mrearsbig/store | f311c48f8e79f6d6fb7bf2c8c9a0b65d1b271ff0 | [
"MIT"
] | 1 | 2021-11-26T21:39:52.000Z | 2021-11-26T21:39:52.000Z | orders/serializers/orderserializer.py | mrearsbig/backend | f311c48f8e79f6d6fb7bf2c8c9a0b65d1b271ff0 | [
"MIT"
] | null | null | null | orders/serializers/orderserializer.py | mrearsbig/backend | f311c48f8e79f6d6fb7bf2c8c9a0b65d1b271ff0 | [
"MIT"
] | null | null | null | from rest_framework.serializers import ModelSerializer
from orders.models import Order
class OrderSerializer(ModelSerializer):
class Meta:
model = Order
fields = '__all__'
def to_representation(self, instance):
return {
'id': instance.id,
'date': instance.date,... | 26.368421 | 54 | 0.57485 | from rest_framework.serializers import ModelSerializer
from orders.models import Order
class OrderSerializer(ModelSerializer):
class Meta:
model = Order
fields = '__all__'
def to_representation(self, instance):
return {
'id': instance.id,
'date': instance.date,... | true | true |
1c2b3604c195de56b7956ab80df51689484ff57b | 815 | py | Python | lib/mplcairo/tk.py | TomJohnZ/mplcairo | b5d119cacd39eeeb6f5e166e11f3ede52b5a28fd | [
"MIT"
] | 55 | 2019-08-03T00:01:19.000Z | 2022-03-02T21:46:51.000Z | lib/mplcairo/tk.py | TomJohnZ/mplcairo | b5d119cacd39eeeb6f5e166e11f3ede52b5a28fd | [
"MIT"
] | 23 | 2019-09-07T14:52:43.000Z | 2022-03-05T19:46:52.000Z | lib/mplcairo/tk.py | TomJohnZ/mplcairo | b5d119cacd39eeeb6f5e166e11f3ede52b5a28fd | [
"MIT"
] | 16 | 2018-03-15T11:57:47.000Z | 2019-03-23T06:03:06.000Z | from functools import partial
from matplotlib.backends._backend_tk import _BackendTk, FigureCanvasTk
from . import _util
from .base import FigureCanvasCairo
try:
from matplotlib.backends._backend_tk import blit as _mpl3_blit
_tk_blit = partial(_mpl3_blit, offsets=(0, 1, 2, 3))
except ImportError:
from ma... | 27.166667 | 70 | 0.737423 | from functools import partial
from matplotlib.backends._backend_tk import _BackendTk, FigureCanvasTk
from . import _util
from .base import FigureCanvasCairo
try:
from matplotlib.backends._backend_tk import blit as _mpl3_blit
_tk_blit = partial(_mpl3_blit, offsets=(0, 1, 2, 3))
except ImportError:
from ma... | true | true |
1c2b36405b1140476ad624fc00313de58fe5b45e | 9,495 | py | Python | tests/unit/test_dynamodb.py | ongzhixian/dana_trading_bot | 746d080a42f6c43ab9a96df7b272062a88f47f56 | [
"MIT"
] | null | null | null | tests/unit/test_dynamodb.py | ongzhixian/dana_trading_bot | 746d080a42f6c43ab9a96df7b272062a88f47f56 | [
"MIT"
] | null | null | null | tests/unit/test_dynamodb.py | ongzhixian/dana_trading_bot | 746d080a42f6c43ab9a96df7b272062a88f47f56 | [
"MIT"
] | null | null | null | import unittest
import boto3
from boto3.dynamodb.types import Binary, Decimal
import requests
import warnings
from unittest.mock import patch, Mock
from mods.ddb import store, retrieve, remove
class TestDdb(unittest.TestCase):
# Dictionary of mock test data
# 'RequestId': '75N4RS5BDFE4NGOK864RHBFBH7VV4KQNSO5... | 34.154676 | 114 | 0.596419 | import unittest
import boto3
from boto3.dynamodb.types import Binary, Decimal
import requests
import warnings
from unittest.mock import patch, Mock
from mods.ddb import store, retrieve, remove
class TestDdb(unittest.TestCase):
mock_data = {
'RESPONSE_METADATA' : {
'ResponseMetadata'... | true | true |
1c2b3794e77dd8e127e577dd7e5b38673d933e02 | 16,440 | py | Python | src/poetry/mixology/incompatibility.py | mmacchia/poetry | 7c53db9680d021bac99cc366a3bbc88ebbffdf0f | [
"MIT"
] | null | null | null | src/poetry/mixology/incompatibility.py | mmacchia/poetry | 7c53db9680d021bac99cc366a3bbc88ebbffdf0f | [
"MIT"
] | null | null | null | src/poetry/mixology/incompatibility.py | mmacchia/poetry | 7c53db9680d021bac99cc366a3bbc88ebbffdf0f | [
"MIT"
] | null | null | null | from typing import Callable
from typing import Dict
from typing import Iterator
from typing import List
from typing import Optional
from typing import Union
from poetry.mixology.incompatibility_cause import ConflictCause
from poetry.mixology.incompatibility_cause import DependencyCause
from poetry.mixology.incompatibi... | 34.393305 | 91 | 0.568127 | from typing import Callable
from typing import Dict
from typing import Iterator
from typing import List
from typing import Optional
from typing import Union
from poetry.mixology.incompatibility_cause import ConflictCause
from poetry.mixology.incompatibility_cause import DependencyCause
from poetry.mixology.incompatibi... | true | true |
1c2b37b0c65c4c2670dc787d819a3d20aeae9092 | 93 | py | Python | skeleton/pixelwars/apps.py | GenchoBG/HackTues3 | 1457d44d6f6aeef158e49f91ce4a40246afe9c62 | [
"MIT"
] | null | null | null | skeleton/pixelwars/apps.py | GenchoBG/HackTues3 | 1457d44d6f6aeef158e49f91ce4a40246afe9c62 | [
"MIT"
] | null | null | null | skeleton/pixelwars/apps.py | GenchoBG/HackTues3 | 1457d44d6f6aeef158e49f91ce4a40246afe9c62 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class PixelwarsConfig(AppConfig):
name = 'pixelwars'
| 15.5 | 33 | 0.763441 | from django.apps import AppConfig
class PixelwarsConfig(AppConfig):
name = 'pixelwars'
| true | true |
1c2b380a48509c5afcad0bf4a34adea41e89cc5e | 530 | py | Python | scripts/data_pop.py | ifryed/LinearNet | f4fbdcdc98c275a6c21c9efbbc357aa9e88aed6c | [
"MIT"
] | 3 | 2021-10-05T20:43:13.000Z | 2021-10-09T20:59:47.000Z | scripts/data_pop.py | ifryed/LinearNet | f4fbdcdc98c275a6c21c9efbbc357aa9e88aed6c | [
"MIT"
] | null | null | null | scripts/data_pop.py | ifryed/LinearNet | f4fbdcdc98c275a6c21c9efbbc357aa9e88aed6c | [
"MIT"
] | null | null | null | import os
import sys
import numpy as np
from skimage import io
def main():
images = os.listdir(sys.argv[1])
pop_n = int(sys.argv[2]) if len(sys.argv) > 1 else 200
img = io.imread(os.path.join(sys.argv[1], images[0]))
h, w = img.shape[:2]
crop_size = 256
for i in range(pop_n):
x, y = ... | 24.090909 | 96 | 0.609434 | import os
import sys
import numpy as np
from skimage import io
def main():
images = os.listdir(sys.argv[1])
pop_n = int(sys.argv[2]) if len(sys.argv) > 1 else 200
img = io.imread(os.path.join(sys.argv[1], images[0]))
h, w = img.shape[:2]
crop_size = 256
for i in range(pop_n):
x, y = ... | true | true |
1c2b393f8b5be892bd281a729a6d6f4b16059d4d | 31,890 | py | Python | tensorflow_federated/python/core/api/intrinsics_test.py | abhinavsp0730/federated | 7c5821f85cb2d0379f33bf2b5e02f97d51a16427 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/api/intrinsics_test.py | abhinavsp0730/federated | 7c5821f85cb2d0379f33bf2b5e02f97d51a16427 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/api/intrinsics_test.py | abhinavsp0730/federated | 7c5821f85cb2d0379f33bf2b5e02f97d51a16427 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2018, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 36.82448 | 100 | 0.6963 |
import collections
import itertools
import warnings
from absl.testing import parameterized
import numpy as np
import tensorflow as tf
from tensorflow_federated.python.common_libs import anonymous_tuple
from tensorflow_federated.python.common_libs import test as common_test
from tensorflow_federated.pyt... | true | true |
1c2b394e3a4820d61b1052b437d5ca661ba3b5b2 | 4,911 | py | Python | src/CurlCallee.py | 8ldesign/DataFeedsTester | 187af657cde369baef9f1e00222db5c42320307b | [
"MIT"
] | null | null | null | src/CurlCallee.py | 8ldesign/DataFeedsTester | 187af657cde369baef9f1e00222db5c42320307b | [
"MIT"
] | null | null | null | src/CurlCallee.py | 8ldesign/DataFeedsTester | 187af657cde369baef9f1e00222db5c42320307b | [
"MIT"
] | null | null | null | import logging, re, os, fnmatch, requests
from requests import exceptions
from FileConstants import FileConstants
from HTTPConstants import HTTPConstants
def main():
try:
calleeObj = CurlCallee()
calleeObj.execute()
except KeyboardInterrupt:
logging.info("Program exited by user")
... | 40.925 | 104 | 0.547343 | import logging, re, os, fnmatch, requests
from requests import exceptions
from FileConstants import FileConstants
from HTTPConstants import HTTPConstants
def main():
try:
calleeObj = CurlCallee()
calleeObj.execute()
except KeyboardInterrupt:
logging.info("Program exited by user")
... | true | true |
1c2b3ae4f9373b4a2647979ff3fbb85f9a020e94 | 601 | py | Python | test/programytest/parser/template/graph_tests/test_think.py | cdoebler1/AIML2 | ee692ec5ea3794cd1bc4cc8ec2a6b5e5c20a0d6a | [
"MIT"
] | 345 | 2016-11-23T22:37:04.000Z | 2022-03-30T20:44:44.000Z | test/programytest/parser/template/graph_tests/test_think.py | MikeyBeez/program-y | 00d7a0c7d50062f18f0ab6f4a041068e119ef7f0 | [
"MIT"
] | 275 | 2016-12-07T10:30:28.000Z | 2022-02-08T21:28:33.000Z | test/programytest/parser/template/graph_tests/test_think.py | VProgramMist/modified-program-y | f32efcafafd773683b3fe30054d5485fe9002b7d | [
"MIT"
] | 159 | 2016-11-28T18:59:30.000Z | 2022-03-20T18:02:44.000Z | import xml.etree.ElementTree as ET
from programy.parser.template.nodes.think import TemplateThinkNode
from programytest.parser.template.graph_tests.graph_test_client import TemplateGraphTestClient
class TemplateGraphThinkTests(TemplateGraphTestClient):
def test_think(self):
template = ET.fromstring("""
... | 28.619048 | 94 | 0.737105 | import xml.etree.ElementTree as ET
from programy.parser.template.nodes.think import TemplateThinkNode
from programytest.parser.template.graph_tests.graph_test_client import TemplateGraphTestClient
class TemplateGraphThinkTests(TemplateGraphTestClient):
def test_think(self):
template = ET.fromstring("""
... | true | true |
1c2b3b3dbb6a36d103d655777cd6f8d51f19e477 | 4,145 | py | Python | tests/utils/test_vault.py | george0st/mlrun | 6467d3a5ceadf6cd35512b84b3ddc3da611cf39a | [
"Apache-2.0"
] | null | null | null | tests/utils/test_vault.py | george0st/mlrun | 6467d3a5ceadf6cd35512b84b3ddc3da611cf39a | [
"Apache-2.0"
] | null | null | null | tests/utils/test_vault.py | george0st/mlrun | 6467d3a5ceadf6cd35512b84b3ddc3da611cf39a | [
"Apache-2.0"
] | null | null | null | import pytest
import mlrun
from mlrun import code_to_function, get_run_db, mlconf, new_project, new_task
from mlrun.utils.vault import VaultStore
from tests.conftest import examples_path, out_path, verify_state
# Set a proper token value for Vault test
user_token = ""
# Set test secrets and configurations - you may... | 34.541667 | 84 | 0.710977 | import pytest
import mlrun
from mlrun import code_to_function, get_run_db, mlconf, new_project, new_task
from mlrun.utils.vault import VaultStore
from tests.conftest import examples_path, out_path, verify_state
user_token = ""
def _set_vault_mlrun_configuration(api_server_port=None):
if api_server_port:
... | true | true |
1c2b3b9071125c065a9e9fb7879789b2fcfd2848 | 5,455 | py | Python | keras/utils/test_utils.py | entraned/keras | 9400be98783135a1d42dd238f4e6c3aa048eceea | [
"MIT"
] | 1 | 2019-03-31T00:51:26.000Z | 2019-03-31T00:51:26.000Z | keras/utils/test_utils.py | entraned/keras | 9400be98783135a1d42dd238f4e6c3aa048eceea | [
"MIT"
] | null | null | null | keras/utils/test_utils.py | entraned/keras | 9400be98783135a1d42dd238f4e6c3aa048eceea | [
"MIT"
] | 1 | 2021-03-08T02:28:07.000Z | 2021-03-08T02:28:07.000Z | """Utilities related to Keras unit tests."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from numpy.testing import assert_allclose
import six
from .generic_utils import has_arg
from ..engine import Model, Input
from ..models import Se... | 35.422078 | 79 | 0.659028 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from numpy.testing import assert_allclose
import six
from .generic_utils import has_arg
from ..engine import Model, Input
from ..models import Sequential
from ..models import model_from_json... | true | true |
1c2b3c1e5a3c81bd0768611b83ddf8ff8f4054ec | 21,136 | py | Python | statsmodels/base/elastic_net.py | xiaowei1234/statsmodels | a8faaf72b7881620552acace6ca352b8bc628dcd | [
"BSD-3-Clause"
] | null | null | null | statsmodels/base/elastic_net.py | xiaowei1234/statsmodels | a8faaf72b7881620552acace6ca352b8bc628dcd | [
"BSD-3-Clause"
] | null | null | null | statsmodels/base/elastic_net.py | xiaowei1234/statsmodels | a8faaf72b7881620552acace6ca352b8bc628dcd | [
"BSD-3-Clause"
] | 4 | 2020-04-07T00:06:17.000Z | 2021-06-17T15:11:36.000Z | import numpy as np
from statsmodels.base.model import Results
import statsmodels.base.wrapper as wrap
from statsmodels.tools.decorators import cache_readonly
from statsmodels.base.constraint import ConstraintProjector
"""
Elastic net regularization.
Routines for fitting regression models using elastic net
regularizat... | 34.535948 | 120 | 0.633232 | import numpy as np
from statsmodels.base.model import Results
import statsmodels.base.wrapper as wrap
from statsmodels.tools.decorators import cache_readonly
from statsmodels.base.constraint import ConstraintProjector
def _gen_npfuncs(k, L1_wt, alpha, loglike_kwds, score_kwds, hess_kwds):
def nploglike(params, ... | true | true |
1c2b3cdb92e9d64974b419e6e1547380d9683c17 | 2,948 | py | Python | platforms/osx/build_framework.py | thisisgopalmandal/opencv | 4e2ef8c8f57644ccb8e762a37f70a61007c6be1c | [
"BSD-3-Clause"
] | 56 | 2020-03-24T15:17:56.000Z | 2022-03-21T13:44:08.000Z | platforms/osx/build_framework.py | thisisgopalmandal/opencv | 4e2ef8c8f57644ccb8e762a37f70a61007c6be1c | [
"BSD-3-Clause"
] | 6 | 2021-03-08T13:41:24.000Z | 2022-02-19T08:10:24.000Z | platforms/osx/build_framework.py | thisisgopalmandal/opencv | 4e2ef8c8f57644ccb8e762a37f70a61007c6be1c | [
"BSD-3-Clause"
] | 15 | 2020-05-06T13:41:20.000Z | 2022-03-31T19:15:47.000Z | #!/usr/bin/env python
"""
The script builds OpenCV.framework for OSX.
"""
from __future__ import print_function
import os, os.path, sys, argparse, traceback, multiprocessing
# import common code
sys.path.insert(0, os.path.abspath(os.path.abspath(os.path.dirname(__file__))+'/../ios'))
from build_framework import Build... | 49.966102 | 172 | 0.700814 |
from __future__ import print_function
import os, os.path, sys, argparse, traceback, multiprocessing
sys.path.insert(0, os.path.abspath(os.path.abspath(os.path.dirname(__file__))+'/../ios'))
from build_framework import Builder
MACOSX_DEPLOYMENT_TARGET='10.12'
class OSXBuilder(Builder):
def getToolchain(self... | true | true |
1c2b3cff1088f0e7ddef17027fc2cacfb3cb8c7c | 275 | py | Python | apps/public/schemas.py | aeasringnar/tornado-RESTfulAPI | 911b8d52fdcc8f5a5b96343e74d0ac987f661bd4 | [
"MIT"
] | 5 | 2020-07-31T10:14:09.000Z | 2022-03-03T06:04:21.000Z | apps/public/schemas.py | aeasringnar/tornado-RESTfulAPI | 911b8d52fdcc8f5a5b96343e74d0ac987f661bd4 | [
"MIT"
] | 2 | 2021-06-08T22:12:15.000Z | 2022-01-13T03:09:14.000Z | apps/public/schemas.py | aeasringnar/tornado-RESTfulAPI | 911b8d52fdcc8f5a5b96343e74d0ac987f661bd4 | [
"MIT"
] | 4 | 2020-08-20T15:35:20.000Z | 2022-03-29T11:10:06.000Z | from marshmallow import Schema, fields, ValidationError, validate, validates, pre_load, validates_schema
from base.schema import BaseSchema
class GetMobielCoseSchema(BaseSchema):
mobile = fields.String(label='手机号', required=True, error_messages={"required": "请输入手机号。"}) | 45.833333 | 104 | 0.796364 | from marshmallow import Schema, fields, ValidationError, validate, validates, pre_load, validates_schema
from base.schema import BaseSchema
class GetMobielCoseSchema(BaseSchema):
mobile = fields.String(label='手机号', required=True, error_messages={"required": "请输入手机号。"}) | true | true |
1c2b3ee2cd92e219a0e9956a2ecceaeadd5559a8 | 543 | py | Python | misc/code reference.py | flyingpizza/kaggel-workouts | 744a27736fa7878b24f2fc4dc43e956c49b21fef | [
"MIT"
] | null | null | null | misc/code reference.py | flyingpizza/kaggel-workouts | 744a27736fa7878b24f2fc4dc43e956c49b21fef | [
"MIT"
] | null | null | null | misc/code reference.py | flyingpizza/kaggel-workouts | 744a27736fa7878b24f2fc4dc43e956c49b21fef | [
"MIT"
] | null | null | null | # code to create subplot
import seaborn as sns
import matplotlib.pyplot as plt
fig = plt.figure(figsize = (18, 20))
for index in range(len(cat_features)):
plt.subplot(8, 5, index + 1)
sns.countplot(data = train.dropna(), x = train.loc[:, cat_features[index]])
plt.xticks(rotation = 90)
plt.tight_layout... | 21.72 | 79 | 0.694291 |
import seaborn as sns
import matplotlib.pyplot as plt
fig = plt.figure(figsize = (18, 20))
for index in range(len(cat_features)):
plt.subplot(8, 5, index + 1)
sns.countplot(data = train.dropna(), x = train.loc[:, cat_features[index]])
plt.xticks(rotation = 90)
plt.tight_layout()
impo... | true | true |
1c2b3f19b287c8900a950d123b13e171d11d9b47 | 16,788 | py | Python | manimlib/mobject/svg/svg_mobject.py | pu17/manim_project | dfea9f6b40c6f78f918970ca5e4574b92839bf0d | [
"MIT"
] | 1 | 2021-02-01T00:40:34.000Z | 2021-02-01T00:40:34.000Z | manimlib/mobject/svg/svg_mobject.py | mohamedballa/manim | fe85d4e02f6935c49fb0b88eebbd492dfff2d324 | [
"MIT"
] | 1 | 2021-02-02T03:43:05.000Z | 2021-02-02T03:43:05.000Z | manimlib/mobject/svg/svg_mobject.py | mohamedballa/manim | fe85d4e02f6935c49fb0b88eebbd492dfff2d324 | [
"MIT"
] | null | null | null | import itertools as it
import re
import string
import warnings
import os
import hashlib
from xml.dom import minidom
from manimlib.constants import DEFAULT_STROKE_WIDTH
from manimlib.constants import ORIGIN, UP, DOWN, LEFT, RIGHT
from manimlib.constants import BLACK
from manimlib.constants import WHITE
from manimlib.... | 36.977974 | 99 | 0.591077 | import itertools as it
import re
import string
import warnings
import os
import hashlib
from xml.dom import minidom
from manimlib.constants import DEFAULT_STROKE_WIDTH
from manimlib.constants import ORIGIN, UP, DOWN, LEFT, RIGHT
from manimlib.constants import BLACK
from manimlib.constants import WHITE
from manimlib.... | true | true |
1c2b3fef6027163a9008d96f75b22e02d4bff261 | 704 | py | Python | 3_complex_deps/setup.py | fracpete/python-console-scripts | d453e492fc19ebc25dee75a2921b27772f9247b3 | [
"MIT"
] | null | null | null | 3_complex_deps/setup.py | fracpete/python-console-scripts | d453e492fc19ebc25dee75a2921b27772f9247b3 | [
"MIT"
] | null | null | null | 3_complex_deps/setup.py | fracpete/python-console-scripts | d453e492fc19ebc25dee75a2921b27772f9247b3 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name="mysuperduperproject",
description="My super duper Project.",
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Topic :: Scientific/Engineering',
'Programming Language :: Python :: 3',
],
... | 21.333333 | 49 | 0.548295 | from setuptools import setup
setup(
name="mysuperduperproject",
description="My super duper Project.",
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Topic :: Scientific/Engineering',
'Programming Language :: Python :: 3',
],
... | true | true |
1c2b4033a165cb65c328c3308770545073b6325e | 3,458 | py | Python | sphinx/util/images.py | pvcraven/sphinx | b103b3c24ac8d983498f1170d8e104f8cd72c3df | [
"BSD-2-Clause"
] | null | null | null | sphinx/util/images.py | pvcraven/sphinx | b103b3c24ac8d983498f1170d8e104f8cd72c3df | [
"BSD-2-Clause"
] | null | null | null | sphinx/util/images.py | pvcraven/sphinx | b103b3c24ac8d983498f1170d8e104f8cd72c3df | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
sphinx.util.images
~~~~~~~~~~~~~~~~~~
Image utility functions for Sphinx.
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import absolute_import
import base64
import imghdr
import imagesize
fr... | 25.240876 | 79 | 0.600925 |
from __future__ import absolute_import
import base64
import imghdr
import imagesize
from os import path
from collections import OrderedDict
from six import PY3, BytesIO, iteritems
from typing import NamedTuple
try:
from PIL import Image
except ImportError:
try:
import Image
except Import... | true | true |
1c2b403d8f76a046dcd02a038b6389cdf69f814c | 446 | py | Python | sacrerouge/data/dataset_readers/__init__.py | danieldeutsch/decomposed-rouge | 0d723be8e3359f0bdcc9c7940336800895e46dbb | [
"Apache-2.0"
] | 81 | 2020-07-10T15:45:08.000Z | 2022-03-30T12:19:11.000Z | sacrerouge/data/dataset_readers/__init__.py | danieldeutsch/decomposed-rouge | 0d723be8e3359f0bdcc9c7940336800895e46dbb | [
"Apache-2.0"
] | 29 | 2020-08-03T21:50:45.000Z | 2022-02-23T14:34:16.000Z | sacrerouge/data/dataset_readers/__init__.py | danieldeutsch/decomposed-rouge | 0d723be8e3359f0bdcc9c7940336800895e46dbb | [
"Apache-2.0"
] | 7 | 2020-08-14T09:54:08.000Z | 2022-03-30T12:19:25.000Z | from sacrerouge.data.dataset_readers.dataset_reader import DatasetReader
from sacrerouge.data.dataset_readers.document_based import DocumentBasedDatasetReader, SplitDocumentBasedDatasetReader
from sacrerouge.data.dataset_readers.pyramid_based import PyramidBasedDatasetReader
from sacrerouge.data.dataset_readers.referen... | 74.333333 | 118 | 0.91704 | from sacrerouge.data.dataset_readers.dataset_reader import DatasetReader
from sacrerouge.data.dataset_readers.document_based import DocumentBasedDatasetReader, SplitDocumentBasedDatasetReader
from sacrerouge.data.dataset_readers.pyramid_based import PyramidBasedDatasetReader
from sacrerouge.data.dataset_readers.referen... | true | true |
1c2b4074fba3021590b0a2b809fcd8d7de83cb64 | 887 | py | Python | webdriver.py | aLily11/xmu-daily-report | ee99d9669d7c318de20d88f8d6723693f9b48e7b | [
"MIT"
] | null | null | null | webdriver.py | aLily11/xmu-daily-report | ee99d9669d7c318de20d88f8d6723693f9b48e7b | [
"MIT"
] | null | null | null | webdriver.py | aLily11/xmu-daily-report | ee99d9669d7c318de20d88f8d6723693f9b48e7b | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.webdriver import WebDriver
from utils import debug
chrome_options = Options()
# 谷歌文档提到需要加上这个属性来规避bug
chrome_options.add_argument('--disable-gpu')
# 隐藏滚动条, 应对一些特殊页面
chrome_options.add_argument('--hide-sc... | 22.175 | 65 | 0.742954 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.webdriver import WebDriver
from utils import debug
chrome_options = Options()
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument('--hide-scrollbars')
chrome_options.add_argument... | true | true |
1c2b4110f88f48555cdc775f285c52646d4c6b49 | 1,081 | py | Python | bvs/background_verification/doctype/verify_address_check4/verify_address_check4.py | vhrspvl/vhrs-bvs | 56667039d9cc09ad0b092e5e6c5dd6598ff41e7b | [
"MIT"
] | 1 | 2021-08-19T11:16:47.000Z | 2021-08-19T11:16:47.000Z | bvs/background_verification/doctype/verify_address_check4/verify_address_check4.py | vhrspvl/vhrs-bvs | 56667039d9cc09ad0b092e5e6c5dd6598ff41e7b | [
"MIT"
] | null | null | null | bvs/background_verification/doctype/verify_address_check4/verify_address_check4.py | vhrspvl/vhrs-bvs | 56667039d9cc09ad0b092e5e6c5dd6598ff41e7b | [
"MIT"
] | 4 | 2018-03-21T05:57:54.000Z | 2020-11-26T00:37:29.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018, VHRS and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class VerifyAddressCheck4(Document):
pass
@frappe.whitelist()
def get_check(applicant_id):
address_... | 30.885714 | 116 | 0.653099 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class VerifyAddressCheck4(Document):
pass
@frappe.whitelist()
def get_check(applicant_id):
address_check4_id = frappe.get_list("Address Check4", filters={"applicant_id":applicant_id}, fields=("name"))
return add... | true | true |
1c2b42828634a45d43436a3c4ea189c43a454a0f | 1,510 | py | Python | backend/KeywordMatch.py | jonathanjameswatson/web-app | af4a0f54a06fcd4dfabd19c05b83369533116c7b | [
"MIT"
] | null | null | null | backend/KeywordMatch.py | jonathanjameswatson/web-app | af4a0f54a06fcd4dfabd19c05b83369533116c7b | [
"MIT"
] | 1 | 2022-01-22T15:49:41.000Z | 2022-01-22T15:49:41.000Z | backend/KeywordMatch.py | jonathanjameswatson/web-app | af4a0f54a06fcd4dfabd19c05b83369533116c7b | [
"MIT"
] | 3 | 2022-01-22T14:23:15.000Z | 2022-01-22T18:01:39.000Z | import yake
from nltk.stem import PorterStemmer
class KeywordMatch:
def __init__(self):
language = "en"
max_ngram_size = 3
deduplication_threshold = 0.9
numOfKeywords = 5
self.custom_kw_extractor = yake.KeywordExtractor(
lan=language,
n=max_ngram_siz... | 27.454545 | 77 | 0.543709 | import yake
from nltk.stem import PorterStemmer
class KeywordMatch:
def __init__(self):
language = "en"
max_ngram_size = 3
deduplication_threshold = 0.9
numOfKeywords = 5
self.custom_kw_extractor = yake.KeywordExtractor(
lan=language,
n=max_ngram_siz... | true | true |
1c2b428b594614f8cb16beb47d54c5472904cb6b | 1,819 | py | Python | vsts/vsts/test/v4_1/models/test_result_model_base.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/test/v4_1/models/test_result_model_base.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/test/v4_1/models/test_result_model_base.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 39.543478 | 132 | 0.563496 |
from msrest.serialization import Model
class TestResultModelBase(Model):
_attribute_map = {
'comment': {'key': 'comment', 'type': 'str'},
'completed_date': {'key': 'completedDate', 'type': 'iso-8601'},
'duration_in_ms': {'key': 'durationInMs', 'type': 'float'},
'error_mess... | true | true |
1c2b43d5f5cacb1854bbd69115dbf2fdc09465c1 | 1,109 | py | Python | utils/samplers.py | nvvaulin/medical_imaging | ff00fc43ac0edcfb2151478f89e6c82be40af433 | [
"Apache-2.0"
] | null | null | null | utils/samplers.py | nvvaulin/medical_imaging | ff00fc43ac0edcfb2151478f89e6c82be40af433 | [
"Apache-2.0"
] | null | null | null | utils/samplers.py | nvvaulin/medical_imaging | ff00fc43ac0edcfb2151478f89e6c82be40af433 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
class WeightedClassRandomSampler(torch.utils.data.WeightedRandomSampler):
def __init__(self, labels, class_weights=None, label_names=None, names_weights=None):
if class_weights is None:
class_weights = [names_weights.get(i, None) for i in label_names]
ma... | 46.208333 | 109 | 0.633904 | import numpy as np
import torch
class WeightedClassRandomSampler(torch.utils.data.WeightedRandomSampler):
def __init__(self, labels, class_weights=None, label_names=None, names_weights=None):
if class_weights is None:
class_weights = [names_weights.get(i, None) for i in label_names]
ma... | true | true |
1c2b445c7e3b23d11298841c4f31e3e72c0b3203 | 90,293 | py | Python | tests/unit/gapic/dialogflow_v2beta1/test_versions.py | LaudateCorpus1/python-dialogflow | 0d6bebd2c28d46bfd06d42da30778d3b55a1878e | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/dialogflow_v2beta1/test_versions.py | LaudateCorpus1/python-dialogflow | 0d6bebd2c28d46bfd06d42da30778d3b55a1878e | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/dialogflow_v2beta1/test_versions.py | LaudateCorpus1/python-dialogflow | 0d6bebd2c28d46bfd06d42da30778d3b55a1878e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 38.936179 | 111 | 0.685945 |
import os
import mock
import grpc
from grpc.experimental import aio
import math
import pytest
from proto.marshal.rules.dates import DurationRule, TimestampRule
from google.api_core import client_options
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from... | true | true |
1c2b446ecc23d924dba0c07b4632ad36b37b677c | 522 | py | Python | python/blender/render_minimal_demo.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 23 | 2015-06-08T13:01:00.000Z | 2021-12-30T08:20:04.000Z | python/blender/render_minimal_demo.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 1 | 2020-10-22T02:36:10.000Z | 2020-10-22T02:36:10.000Z | python/blender/render_minimal_demo.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 7 | 2017-10-31T09:48:14.000Z | 2022-01-04T15:59:45.000Z | # A minimal example of render of the default scene.
# The blender default scene contain a cube, a lamp and a camera.
# USAGE: blender --background --python render_minimal_demo.py
# See http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/Python
import bpy
# Alias
render = bpy.context.scene.render
# Set rend... | 23.727273 | 72 | 0.764368 |
import bpy
render = bpy.context.scene.render
render.resolution_x = 800
render.resolution_y = 600
render.filepath = 'out.png'
bpy.ops.render.render(write_still=True)
| true | true |
1c2b44b17c7a42098dd9c09f3dbf8d2d50c5c78a | 8,629 | py | Python | tests/test_split.py | Jeremiah-England/Shapely | 769b203f2b7cbeeb0a694c21440b4025a563f807 | [
"BSD-3-Clause"
] | 2,382 | 2015-01-04T03:16:59.000Z | 2021-12-10T15:48:56.000Z | tests/test_split.py | Jeremiah-England/Shapely | 769b203f2b7cbeeb0a694c21440b4025a563f807 | [
"BSD-3-Clause"
] | 1,009 | 2015-01-03T23:44:02.000Z | 2021-12-10T16:02:42.000Z | tests/test_split.py | Jeremiah-England/Shapely | 769b203f2b7cbeeb0a694c21440b4025a563f807 | [
"BSD-3-Clause"
] | 467 | 2015-01-19T23:18:33.000Z | 2021-12-09T18:31:28.000Z | from shapely.ops import split
from . import unittest
from shapely.errors import GeometryTypeError
from shapely.geometry import Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection
from shapely.ops import linemerge, unary_union
class TestSplitGeometry(unittest.TestCase):
# helper... | 37.354978 | 126 | 0.636343 | from shapely.ops import split
from . import unittest
from shapely.errors import GeometryTypeError
from shapely.geometry import Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection
from shapely.ops import linemerge, unary_union
class TestSplitGeometry(unittest.TestCase):
def he... | true | true |
1c2b44ecfb13bdce6c05318e53447706b0408ecb | 124,747 | py | Python | nikola/nikola.py | asmeurer/nikola | ea1c651bfed0fd6337f1d22cf8dd99899722912c | [
"MIT"
] | null | null | null | nikola/nikola.py | asmeurer/nikola | ea1c651bfed0fd6337f1d22cf8dd99899722912c | [
"MIT"
] | null | null | null | nikola/nikola.py | asmeurer/nikola | ea1c651bfed0fd6337f1d22cf8dd99899722912c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © 2012-2020 Roberto Alsina and others.
# 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 t... | 45.39556 | 259 | 0.577136 |
import datetime
import io
import json
import functools
import logging
import operator
import os
import sys
import mimetypes
from collections import defaultdict
from copy import copy
from urllib.parse import urlparse, urlsplit, urlunsplit, urljoin, unquote, parse_qs
import dateutil.tz
import ... | true | true |
1c2b460701bd3142ad4a0f4b29e7973ff50a5b70 | 1,584 | py | Python | setup.py | anton44eg/fixturegen | dde56578911efaf802a11fe7341becda4febb15d | [
"MIT"
] | null | null | null | setup.py | anton44eg/fixturegen | dde56578911efaf802a11fe7341becda4febb15d | [
"MIT"
] | null | null | null | setup.py | anton44eg/fixturegen | dde56578911efaf802a11fe7341becda4febb15d | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import os
from setuptools import setup, find_packages
VERSION = '0.8'
BASEDIR = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(BASEDIR, 'README.rst')).read()
setup(
name='fixturegen',
version=VERSION,
packages=find_packages(),
include_pack... | 28.8 | 77 | 0.611111 | from __future__ import absolute_import
import os
from setuptools import setup, find_packages
VERSION = '0.8'
BASEDIR = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(BASEDIR, 'README.rst')).read()
setup(
name='fixturegen',
version=VERSION,
packages=find_packages(),
include_pack... | true | true |
1c2b462f393bafc01b1dadb21b016768535775d3 | 580 | py | Python | tuples.py | vikhyatprabhu/python-intermediate | c318c515eb13376f5dfd0f4c3b3d74c8c403ab44 | [
"MIT"
] | null | null | null | tuples.py | vikhyatprabhu/python-intermediate | c318c515eb13376f5dfd0f4c3b3d74c8c403ab44 | [
"MIT"
] | null | null | null | tuples.py | vikhyatprabhu/python-intermediate | c318c515eb13376f5dfd0f4c3b3d74c8c403ab44 | [
"MIT"
] | null | null | null | #Tuple : ordered , immutable , allows duplicate
mytuple = ("Vikhyat" , 28 , "Shirali")
print(mytuple)
singletuple = ("Vikhyat",)
print(singletuple)
#Tuple from iterable
mytuple = tuple(["Vikhyat" , 28 , "Shirali"])
print(mytuple)
item = mytuple[0]
print(item)
# NOT SUPPORTED assignment
# mytuple[1] = 29
#Loop
for... | 20 | 56 | 0.648276 |
mytuple = ("Vikhyat" , 28 , "Shirali")
print(mytuple)
singletuple = ("Vikhyat",)
print(singletuple)
mytuple = tuple(["Vikhyat" , 28 , "Shirali"])
print(mytuple)
item = mytuple[0]
print(item)
for x in mytuple:
print(x)
letters = ('a' , 'b' , 'b' , 'c' , 'a', 'e', 'e')
print(letters.count('b'))
print(lette... | true | true |
1c2b47d3c39b4194cfb90ff049a80f39236b1d76 | 1,403 | py | Python | trackash/users/tests/test_views.py | black-redoc/trackash | 99ded8445eaaa1bdf616d43c36ba402356e2f9d3 | [
"MIT"
] | null | null | null | trackash/users/tests/test_views.py | black-redoc/trackash | 99ded8445eaaa1bdf616d43c36ba402356e2f9d3 | [
"MIT"
] | null | null | null | trackash/users/tests/test_views.py | black-redoc/trackash | 99ded8445eaaa1bdf616d43c36ba402356e2f9d3 | [
"MIT"
] | null | null | null | import pytest
from django.test import RequestFactory
from trackash.users.models import User
from trackash.users.views import UserRedirectView, UserUpdateView
pytestmark = pytest.mark.django_db
class TestUserUpdateView:
"""
TODO:
extracting view initialization code as class-scoped fixture
wou... | 29.851064 | 81 | 0.684248 | import pytest
from django.test import RequestFactory
from trackash.users.models import User
from trackash.users.views import UserRedirectView, UserUpdateView
pytestmark = pytest.mark.django_db
class TestUserUpdateView:
def test_get_success_url(self, user: User, request_factory: RequestFactory):
view = ... | true | true |
1c2b486f75bc1d0322615792bab4ef66e4af1fc3 | 1,843 | py | Python | project_euler/python/058_spiral_primes.py | Sabihxh/ProjectEuler | 8ab1387f41cbce0d5216ed98fa06d754cbc324c1 | [
"MIT"
] | 1 | 2018-03-20T12:04:06.000Z | 2018-03-20T12:04:06.000Z | project_euler/python/058_spiral_primes.py | Sabihxh/ProjectEuler | 8ab1387f41cbce0d5216ed98fa06d754cbc324c1 | [
"MIT"
] | null | null | null | project_euler/python/058_spiral_primes.py | Sabihxh/ProjectEuler | 8ab1387f41cbce0d5216ed98fa06d754cbc324c1 | [
"MIT"
] | null | null | null | from utils import is_prime
problem = """
Starting with 1 and spiralling anticlockwise in the following way,
a square spiral with side length 7 is formed.
37 36 35 34 33 32 31
38 17 16 15 14 13 30
39 18 5 4 3 12 29
40 19 6 1 2 11 28
41 20 7 8 9 10 27
42 21 22 23 24 25 26
43 44 45 46 47 48 49
It is interestin... | 26.328571 | 89 | 0.66522 | from utils import is_prime
problem = """
Starting with 1 and spiralling anticlockwise in the following way,
a square spiral with side length 7 is formed.
37 36 35 34 33 32 31
38 17 16 15 14 13 30
39 18 5 4 3 12 29
40 19 6 1 2 11 28
41 20 7 8 9 10 27
42 21 22 23 24 25 26
43 44 45 46 47 48 49
It is interestin... | true | true |
1c2b49b6074b2fa09d9c940499b2b83155e28ee7 | 2,394 | py | Python | chaospy/distributions/operators/arccos.py | krystophny/chaospy | e09f8e3f6dfc26145f15774edd5b03665140712f | [
"MIT"
] | 1 | 2019-12-20T00:32:44.000Z | 2019-12-20T00:32:44.000Z | chaospy/distributions/operators/arccos.py | QianWanghhu/chaospy | 18ff6c4fc56c632825e53fb24e17de51a7febd7d | [
"MIT"
] | null | null | null | chaospy/distributions/operators/arccos.py | QianWanghhu/chaospy | 18ff6c4fc56c632825e53fb24e17de51a7febd7d | [
"MIT"
] | null | null | null | """Arc-Cosine."""
import numpy
from ..baseclass import Dist
from .. import evaluation, approximation
class Arccos(Dist):
"""
Arc-Cosine.
Args:
dist (Dist): Distribution to perform transformation on.
Example:
>>> distribution = chaospy.Arccos(chaospy.Uniform(0, 1))
>>> print(... | 31.92 | 80 | 0.591061 | import numpy
from ..baseclass import Dist
from .. import evaluation, approximation
class Arccos(Dist):
def __init__(self, dist):
assert isinstance(dist, Dist)
assert numpy.all(dist.range() >= -1)
assert numpy.all(dist.range() <= 1)
Dist.__init__(self, dist=dist)
def _pdf(sel... | true | true |
1c2b4a02dbba8f5c98568033d3c3db8e69c4b68a | 393 | py | Python | sdnantwr/wsgi.py | eewinkk/sdnantwr | 3fc395a2ae268efd7db4d4d4e3424c0c4252ed5b | [
"MIT"
] | null | null | null | sdnantwr/wsgi.py | eewinkk/sdnantwr | 3fc395a2ae268efd7db4d4d4e3424c0c4252ed5b | [
"MIT"
] | null | null | null | sdnantwr/wsgi.py | eewinkk/sdnantwr | 3fc395a2ae268efd7db4d4d4e3424c0c4252ed5b | [
"MIT"
] | null | null | null | """
WSGI config for sdnantwr project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sdnantwr.settings')
application = get_wsgi_application()
| true | true |
1c2b4a1c07a03c84645790de2fd147b0a49af942 | 779 | py | Python | Python Files/Dataset_Formating/Audio_splicing.py | brennanMosher/Music-Genre-Recognition-using-a-Machine-Learning-Appraoch | 7834fe5d709e894322ad76ef118067febaa78bce | [
"MIT"
] | 1 | 2021-04-13T16:22:27.000Z | 2021-04-13T16:22:27.000Z | Python Files/Dataset_Formating/Audio_splicing.py | brennanMosher/Music-Genre-Recognition-using-a-Machine-Learning-Appraoch | 7834fe5d709e894322ad76ef118067febaa78bce | [
"MIT"
] | null | null | null | Python Files/Dataset_Formating/Audio_splicing.py | brennanMosher/Music-Genre-Recognition-using-a-Machine-Learning-Appraoch | 7834fe5d709e894322ad76ef118067febaa78bce | [
"MIT"
] | null | null | null | from pydub import AudioSegment
import os
import math
from pathlib import Path
'''
Splice wav files into multiple segments.
'''
LENGTH = 3 # Set splice length in seconds
def splice(audioPath, outputPath):
# try:
# os.mkdir('Spliced Spectrogram training') # Need to figure out where to put this
# excep... | 25.129032 | 89 | 0.65982 | from pydub import AudioSegment
import os
import math
from pathlib import Path
LENGTH = 3
def splice(audioPath, outputPath):
rom_wav(audioPath)
count = math.ceil(audio.duration_seconds/LENGTH)
t1 = 0
t2 = LENGTH*1000
for i in range(count):
newAudio = audio[t1:t2]
newPath =... | true | true |
1c2b4a412455052ce8ddb06dd979e5dc0bf88080 | 4,941 | py | Python | mstools/molecule/molecule.py | Xiangyan93/mstools | 7143dbfc2eb4e82e6631652a0c1b38a793dcc678 | [
"MIT"
] | null | null | null | mstools/molecule/molecule.py | Xiangyan93/mstools | 7143dbfc2eb4e82e6631652a0c1b38a793dcc678 | [
"MIT"
] | null | null | null | mstools/molecule/molecule.py | Xiangyan93/mstools | 7143dbfc2eb4e82e6631652a0c1b38a793dcc678 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import Dict, Iterator, List, Optional, Union, Literal, Tuple
import warnings
import random
from openbabel import openbabel
import openbabel.pybel as pybel
from .saved_mol2 import get_smiles_mol2_dict
class Molecule:
"""This class is used to create molecula... | 31.272152 | 105 | 0.571747 |
from typing import Dict, Iterator, List, Optional, Union, Literal, Tuple
import warnings
import random
from openbabel import openbabel
import openbabel.pybel as pybel
from .saved_mol2 import get_smiles_mol2_dict
class Molecule:
def __init__(self, smiles: str,
algorithm: Literal['openbabel'] = ... | true | true |
1c2b4a485b7b9fbeba082c6fd516e9b17e38a7db | 4,142 | py | Python | Week3-Web-Development-Using-Python/fastapi/service.py | gdgedmonton/Python-Bootcamp-2020 | 2d5e78608c5e94d4db97e084c2f71ac0eefb213f | [
"MIT"
] | 3 | 2021-01-15T23:24:37.000Z | 2021-08-13T04:01:11.000Z | Week3-Web-Development-Using-Python/fastapi/service.py | gdgedmonton/Python-Bootcamp-2020 | 2d5e78608c5e94d4db97e084c2f71ac0eefb213f | [
"MIT"
] | null | null | null | Week3-Web-Development-Using-Python/fastapi/service.py | gdgedmonton/Python-Bootcamp-2020 | 2d5e78608c5e94d4db97e084c2f71ac0eefb213f | [
"MIT"
] | 1 | 2021-01-31T20:11:49.000Z | 2021-01-31T20:11:49.000Z | from datetime import datetime
from typing import List
from urllib.parse import urlunparse
import uuid
import aiohttp
from fastapi import FastAPI, HTTPException
from fuzzywuzzy import process
from pydantic import AnyHttpUrl, BaseModel, Field
from starlette.requests import Request
async def fetch_team_wins() -> dict:
... | 28.965035 | 87 | 0.667069 | from datetime import datetime
from typing import List
from urllib.parse import urlunparse
import uuid
import aiohttp
from fastapi import FastAPI, HTTPException
from fuzzywuzzy import process
from pydantic import AnyHttpUrl, BaseModel, Field
from starlette.requests import Request
async def fetch_team_wins() -> dict:
... | true | true |
1c2b4b0457b868b3077a5a8dbc6d0f7f70328b3f | 12,842 | py | Python | lib/net/fcn.py | Guo-Xiaoqing/ThresholdNet | 460026bdacd9d5e577e9b4ae1370e8c9924fcfc3 | [
"MIT"
] | 7 | 2020-12-29T14:09:27.000Z | 2021-07-08T07:12:24.000Z | lib/net/fcn.py | CityU-AIM-Group/ThresholdNet | e82da9f1266c07518c4037d0a0b3afd6290ca33d | [
"MIT"
] | null | null | null | lib/net/fcn.py | CityU-AIM-Group/ThresholdNet | e82da9f1266c07518c4037d0a0b3afd6290ca33d | [
"MIT"
] | 2 | 2021-04-08T11:59:07.000Z | 2021-08-09T15:16:41.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import models
from torchvision.models.vgg import VGG
class FCN32s(nn.Module):
def __init__(self, pretrained_net, n_class):
super().__init__()
self.n_clas... | 48.460377 | 117 | 0.592275 |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import models
from torchvision.models.vgg import VGG
class FCN32s(nn.Module):
def __init__(self, pretrained_net, n_class):
super().__init__()
self.n_class = n_class
sel... | true | true |
1c2b4bf497975578da315d9f93461e4bcfe65e56 | 2,198 | py | Python | tests/python-opcua/examples/simple-client-server-xml/server.py | iit-danieli-joint-lab/opcua-modeling-tool | f8c3d940a61334b0e6deda9099844a6b429d7c08 | [
"MIT"
] | 32 | 2018-03-27T12:25:24.000Z | 2022-01-11T21:20:06.000Z | tests/python-opcua/examples/simple-client-server-xml/server.py | iit-danieli-joint-lab/opcua-modeling-tool | f8c3d940a61334b0e6deda9099844a6b429d7c08 | [
"MIT"
] | 42 | 2020-08-20T04:01:12.000Z | 2021-01-09T18:50:21.000Z | python-opcua/examples/simple-client-server-xml/server.py | ssriblo/ionic-smarthome-test-1 | 060bc247e0b8295d6cd869d90b364756515cfc19 | [
"MIT"
] | 12 | 2018-06-04T20:06:06.000Z | 2021-07-02T22:09:53.000Z | import os.path
try:
from IPython import embed
except ImportError:
import code
def embed():
vars = globals()
vars.update(locals())
shell = code.InteractiveConsole(vars)
shell.interact()
from opcua import ua, uamethod, Server
@uamethod
def say_hello_xml(parent, happy):
... | 25.55814 | 117 | 0.645132 | import os.path
try:
from IPython import embed
except ImportError:
import code
def embed():
vars = globals()
vars.update(locals())
shell = code.InteractiveConsole(vars)
shell.interact()
from opcua import ua, uamethod, Server
@uamethod
def say_hello_xml(parent, happy):
... | true | true |
1c2b4c8a02572640013e7d4e503ee3614d3ab2b7 | 598 | py | Python | codes/views.py | DanielArturoAlejoAlvarez/Cersei | 365cb4e554146143fb3521a09ebf9fadb127a564 | [
"MIT"
] | 5 | 2020-04-07T14:31:45.000Z | 2021-04-30T05:11:43.000Z | codes/views.py | DanielArturoAlejoAlvarez/Cersei | 365cb4e554146143fb3521a09ebf9fadb127a564 | [
"MIT"
] | null | null | null | codes/views.py | DanielArturoAlejoAlvarez/Cersei | 365cb4e554146143fb3521a09ebf9fadb127a564 | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
from rest_framework import viewsets
from .models import Language,Paradigm,Programmer
from .serializers import LanguageSerializer,ParadigmSerializer,ProgrammerSerializer
class LanguageView(viewsets.ModelViewSet):
queryset=Language.objects.all()
seri... | 31.473684 | 83 | 0.832776 | from django.shortcuts import render
from rest_framework import viewsets
from .models import Language,Paradigm,Programmer
from .serializers import LanguageSerializer,ParadigmSerializer,ProgrammerSerializer
class LanguageView(viewsets.ModelViewSet):
queryset=Language.objects.all()
serializer_class=LanguageSeri... | true | true |
1c2b4ca4ff9cd52813ee18f751ac9262164b8b7c | 825 | py | Python | test/post.py | 6923403/Python_Demo | 69ebc7fe5589b46a470c7d88507ce2c73d4c6678 | [
"MIT"
] | null | null | null | test/post.py | 6923403/Python_Demo | 69ebc7fe5589b46a470c7d88507ce2c73d4c6678 | [
"MIT"
] | null | null | null | test/post.py | 6923403/Python_Demo | 69ebc7fe5589b46a470c7d88507ce2c73d4c6678 | [
"MIT"
] | null | null | null | import requests
import json
def main():
host='http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule'
word = host
endpoint = "post"
url=''.join([host, endpoint])
m_data={
"i": "晚安",
"from": "AUTO",
"to": "AUTO",
"smartresult": "dict",
"client": ... | 24.264706 | 81 | 0.591515 | import requests
import json
def main():
host='http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule'
word = host
endpoint = "post"
url=''.join([host, endpoint])
m_data={
"i": "晚安",
"from": "AUTO",
"to": "AUTO",
"smartresult": "dict",
"client": ... | true | true |
1c2b4caaa1a2a9e62eca83baf2fcc132b0a26879 | 8,564 | py | Python | great_expectations/expectations/core/expect_column_values_to_be_unique.py | andyjessen/great_expectations | 74f7f2aa7b51144f34156ed49490dae4edaa5cb7 | [
"Apache-2.0"
] | null | null | null | great_expectations/expectations/core/expect_column_values_to_be_unique.py | andyjessen/great_expectations | 74f7f2aa7b51144f34156ed49490dae4edaa5cb7 | [
"Apache-2.0"
] | null | null | null | great_expectations/expectations/core/expect_column_values_to_be_unique.py | andyjessen/great_expectations | 74f7f2aa7b51144f34156ed49490dae4edaa5cb7 | [
"Apache-2.0"
] | null | null | null | from typing import Optional
from great_expectations.core.expectation_configuration import ExpectationConfiguration
from great_expectations.expectations.expectation import (
ColumnMapExpectation,
InvalidExpectationConfigurationError,
)
from great_expectations.expectations.util import render_evaluation_parameter... | 38.232143 | 107 | 0.608711 | from typing import Optional
from great_expectations.core.expectation_configuration import ExpectationConfiguration
from great_expectations.expectations.expectation import (
ColumnMapExpectation,
InvalidExpectationConfigurationError,
)
from great_expectations.expectations.util import render_evaluation_parameter... | true | true |
1c2b4d2407ea1b399ac8adc0f3b5894a3aaab7e3 | 542 | py | Python | multiples_of_x_and_y/calculator.py | corker/multiples_of_x_and_y | 38a9da13594a3de0a6b8f018193fde20ba38eb7d | [
"MIT"
] | null | null | null | multiples_of_x_and_y/calculator.py | corker/multiples_of_x_and_y | 38a9da13594a3de0a6b8f018193fde20ba38eb7d | [
"MIT"
] | null | null | null | multiples_of_x_and_y/calculator.py | corker/multiples_of_x_and_y | 38a9da13594a3de0a6b8f018193fde20ba38eb7d | [
"MIT"
] | null | null | null |
MIN_GOAL = 1
def calculate(x, y, goal):
assert x > 0
assert y > 0
assert goal >= MIN_GOAL
range_numbers = range(MIN_GOAL, goal)
condition = as_condition(x, y)
filtered_numbers = filter(condition, range_numbers)
return tuple(filtered_numbers)
def as_condition(x, y):
assert x > 0
as... | 23.565217 | 72 | 0.667897 |
MIN_GOAL = 1
def calculate(x, y, goal):
assert x > 0
assert y > 0
assert goal >= MIN_GOAL
range_numbers = range(MIN_GOAL, goal)
condition = as_condition(x, y)
filtered_numbers = filter(condition, range_numbers)
return tuple(filtered_numbers)
def as_condition(x, y):
assert x > 0
as... | true | true |
1c2b4debf7e4d8dde139c8cb3e4ed6b1436b41ad | 6,817 | py | Python | ch_05/src/classifier.py | real-slim-chadi/Python-Object-Oriented-Programming---4th-edition | 7c486866171786b620795fa33a79ec9ac9a8ba1b | [
"MIT"
] | 43 | 2021-06-03T18:39:09.000Z | 2022-03-29T20:32:13.000Z | ch_05/src/classifier.py | real-slim-chadi/Python-Object-Oriented-Programming---4th-edition | 7c486866171786b620795fa33a79ec9ac9a8ba1b | [
"MIT"
] | 9 | 2022-03-12T01:04:07.000Z | 2022-03-12T01:05:01.000Z | ch_05/src/classifier.py | real-slim-chadi/Python-Object-Oriented-Programming---4th-edition | 7c486866171786b620795fa33a79ec9ac9a8ba1b | [
"MIT"
] | 36 | 2021-06-19T07:14:09.000Z | 2022-03-12T22:17:09.000Z | """
Python 3 Object-Oriented Programming Case Study
Chapter 5, When to Use Object-Oriented Programming
"""
from __future__ import annotations
import base64
import csv
from enum import Enum, auto
from functools import wraps
from pathlib import Path
from typing import (
cast,
Optional,
Callable,
Any,
... | 28.885593 | 98 | 0.593663 | from __future__ import annotations
import base64
import csv
from enum import Enum, auto
from functools import wraps
from pathlib import Path
from typing import (
cast,
Optional,
Callable,
Any,
Type,
Set,
Mapping,
overload,
Iterable,
Union,
Iterator,
)
import werkzeug.security... | true | true |
1c2b4eecc8e1717a45520c3b8840de0d0f2b3a1f | 41 | py | Python | pyml_ensemble/model/__init__.py | anthonymorast/pyml-ensemble | a52e454f4c8d92412b3ee66140f78d19da32b53c | [
"MIT"
] | null | null | null | pyml_ensemble/model/__init__.py | anthonymorast/pyml-ensemble | a52e454f4c8d92412b3ee66140f78d19da32b53c | [
"MIT"
] | 5 | 2020-02-13T03:55:53.000Z | 2021-02-12T17:53:15.000Z | pyml_ensemble/model/__init__.py | anthonymorast/pyml-ensemble | a52e454f4c8d92412b3ee66140f78d19da32b53c | [
"MIT"
] | null | null | null | from .model import *
from .tree import *
| 13.666667 | 20 | 0.707317 | from .model import *
from .tree import *
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.