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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c478d69dfa8ae825ea6fc0e5a10dfc164798605 | 3,750 | py | Python | nova/scheduler/filters/disk_filter.py | panguan737/nova | 0d177185a439baa228b42c948cab4e934d6ac7b8 | [
"Apache-2.0"
] | null | null | null | nova/scheduler/filters/disk_filter.py | panguan737/nova | 0d177185a439baa228b42c948cab4e934d6ac7b8 | [
"Apache-2.0"
] | null | null | null | nova/scheduler/filters/disk_filter.py | panguan737/nova | 0d177185a439baa228b42c948cab4e934d6ac7b8 | [
"Apache-2.0"
] | 1 | 2020-11-02T10:17:13.000Z | 2020-11-02T10:17:13.000Z | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 37.5 | 79 | 0.6496 |
from oslo_log import log as logging
import nova.conf
from nova.i18n import _LW
from nova.scheduler import filters
from nova.scheduler.filters import utils
LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
class DiskFilter(filters.BaseHostFilter):
RUN_ON_REBUILD = False
def _get_disk_allocation_rat... | true | true |
1c478dfbc5d80108de891f08ddbc1d37b7c4fa6e | 7,930 | py | Python | tests/user/test_scoreboard.py | HYU-ICEWALL/CTFd | d2d95d882663d39d32527afd4382f07188ecb89a | [
"Apache-2.0"
] | null | null | null | tests/user/test_scoreboard.py | HYU-ICEWALL/CTFd | d2d95d882663d39d32527afd4382f07188ecb89a | [
"Apache-2.0"
] | null | null | null | tests/user/test_scoreboard.py | HYU-ICEWALL/CTFd | d2d95d882663d39d32527afd4382f07188ecb89a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from CTFd.models import Teams, Solves, WrongKeys
from CTFd.utils import get_config, set_config
from CTFd import utils
from tests.helpers import *
from freezegun import freeze_time
from mock import patch
import json
def test_top_10():
'''Make sure top10 returns correc... | 34.034335 | 115 | 0.509458 |
from CTFd.models import Teams, Solves, WrongKeys
from CTFd.utils import get_config, set_config
from CTFd import utils
from tests.helpers import *
from freezegun import freeze_time
from mock import patch
import json
def test_top_10():
app = create_ctfd()
with app.app_context():
register_user(app, name... | true | true |
1c478ed2cb7df85c8da293ebd6985cd21b3671a5 | 3,769 | py | Python | pynventory/hosts.py | kufsa/pynventory | 708e7950c38e873b2a4b7bdc779c0533888ac811 | [
"MIT"
] | null | null | null | pynventory/hosts.py | kufsa/pynventory | 708e7950c38e873b2a4b7bdc779c0533888ac811 | [
"MIT"
] | null | null | null | pynventory/hosts.py | kufsa/pynventory | 708e7950c38e873b2a4b7bdc779c0533888ac811 | [
"MIT"
] | null | null | null | from fabric import Connection
from invoke.exceptions import UnexpectedExit
class LinuxHost:
def __init__(self, host, user):
self.connection = Connection(host, connect_timeout=1, user=user, )
self.host = host
@staticmethod
def display_name():
return 'Host'
def __str__(self):
... | 30.893443 | 106 | 0.555585 | from fabric import Connection
from invoke.exceptions import UnexpectedExit
class LinuxHost:
def __init__(self, host, user):
self.connection = Connection(host, connect_timeout=1, user=user, )
self.host = host
@staticmethod
def display_name():
return 'Host'
def __str__(self):
... | true | true |
1c478ee5315f97fa1a7ac3ba3481af09e56571ff | 786 | py | Python | setup.py | AndrewRPorter/stocki | 0793fe05735c8c803f5cb3ef2ea029a82243dbbd | [
"MIT"
] | 33 | 2018-07-11T19:22:00.000Z | 2021-01-02T13:01:10.000Z | setup.py | AndrewRPorter/stocki | 0793fe05735c8c803f5cb3ef2ea029a82243dbbd | [
"MIT"
] | 2 | 2018-07-12T12:33:46.000Z | 2018-07-16T13:07:59.000Z | setup.py | AndrewRPorter/stocki | 0793fe05735c8c803f5cb3ef2ea029a82243dbbd | [
"MIT"
] | 5 | 2018-07-11T17:22:07.000Z | 2019-03-19T08:48:08.000Z | from setuptools import setup
try:
with open("LICENSE.txt", "r") as f:
_license = f.read()
except Exception:
_license = ""
try:
with open("README.md", "r") as f:
_readme = f.read()
except Exception:
_readme = ""
install_requires = ["requests", "urwid", "pycodestyle"]
setup(
nam... | 22.457143 | 70 | 0.652672 | from setuptools import setup
try:
with open("LICENSE.txt", "r") as f:
_license = f.read()
except Exception:
_license = ""
try:
with open("README.md", "r") as f:
_readme = f.read()
except Exception:
_readme = ""
install_requires = ["requests", "urwid", "pycodestyle"]
setup(
nam... | true | true |
1c478fc5baec380c9474bb2707520c938527aa52 | 1,730 | py | Python | Puzzle5/binaryPartitioning.py | manasharma90/AoC-2020-Python | 6a979eff34136b6b74a340c40121da76e35451da | [
"Apache-2.0"
] | null | null | null | Puzzle5/binaryPartitioning.py | manasharma90/AoC-2020-Python | 6a979eff34136b6b74a340c40121da76e35451da | [
"Apache-2.0"
] | null | null | null | Puzzle5/binaryPartitioning.py | manasharma90/AoC-2020-Python | 6a979eff34136b6b74a340c40121da76e35451da | [
"Apache-2.0"
] | null | null | null |
# defining a function to execute binary partitioning of a list
# input = list; output = tuple with two lists ie. ([first half list], [second half list])
def list_half(input_list):
half = len(input_list)//2
lower_half = input_list[:half]
upper_half = input_list[half:]
return lower_half, upper_half
w... | 25.441176 | 108 | 0.616185 |
def list_half(input_list):
half = len(input_list)//2
lower_half = input_list[:half]
upper_half = input_list[half:]
return lower_half, upper_half
with open('input.txt', 'r') as f:
a = f.read()
boarding_passes = a.split('\n')
boarding_passes_cleaned = []
for bp in boarding_passes:
if len(bp... | true | true |
1c4790bd2a51657327ca769fe5588e04bb77bab6 | 2,878 | py | Python | python/src/nnabla/backward_function/div2.py | chunxiaosz/nnabla | 9f4249313129d0fd23d304453830157fee96a2e5 | [
"Apache-2.0"
] | 1 | 2019-09-10T06:51:37.000Z | 2019-09-10T06:51:37.000Z | python/src/nnabla/backward_function/div2.py | langbin2014/nnabla | e94bac5bed65337010e2ac07a5937fb862ab2dd8 | [
"Apache-2.0"
] | null | null | null | python/src/nnabla/backward_function/div2.py | langbin2014/nnabla | e94bac5bed65337010e2ac07a5937fb862ab2dd8 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Sony 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 applicabl... | 35.097561 | 91 | 0.589298 |
import numpy as np
import nnabla as nn
import nnabla.functions as F
from .backward_function import BackwardFunction
class Div2Backward(BackwardFunction):
def name(self):
return 'Div2Backward'
def _create_forward_inputs_and_outputs(self, inputs, outputs):
inputs_fwd = []
for ... | true | true |
1c4791f5de8986417f5d44fefb3cdffd7192c28f | 2,568 | py | Python | python_scripts/linear_models_sol_03.py | odotreppe/scikit-learn-mooc | da97773fc9b860371e94e3c72791b0c92471b22d | [
"CC-BY-4.0"
] | 2 | 2021-09-30T11:07:28.000Z | 2021-09-30T11:07:31.000Z | python_scripts/linear_models_sol_03.py | Ravimk07/scikit-learn-mooc | c3aaf8c5a9aa4f1d749ebc1b7d5ae24619fee4bf | [
"CC-BY-4.0"
] | null | null | null | python_scripts/linear_models_sol_03.py | Ravimk07/scikit-learn-mooc | c3aaf8c5a9aa4f1d749ebc1b7d5ae24619fee4bf | [
"CC-BY-4.0"
] | null | null | null | # %% [markdown]
# # 📃 Solution for Exercise M4.03
#
# In all previous notebooks, we only used a single feature in `data`. But we
# have already shown that we could add new features to make the model more
# expressive by deriving new features, based on the original feature.
#
# The aim of this notebook is to train a li... | 35.666667 | 112 | 0.720405 |
from sklearn.datasets import fetch_california_housing
data, target = fetch_california_housing(as_frame=True, return_X_y=True)
target *= 100 data.head()
from sklearn.linear_model import LinearRegression
linear_regression = LinearRegression()
from sklearn.model_selection import cross_validate
cv_results = cross_... | true | true |
1c47920152539c32902149b890e26eb84bfb3c09 | 5,674 | py | Python | novaclient/v1_1/volumes.py | citrix-openstack-build/python-novaclient | 3d73fb36e7c5e5f933560760f46ff6aec74ff093 | [
"Apache-1.1"
] | 1 | 2015-02-16T09:37:00.000Z | 2015-02-16T09:37:00.000Z | novaclient/v1_1/volumes.py | sivel/python-novaclient | 810857849ed32773c38df12785715f89d33e83af | [
"Apache-1.1"
] | null | null | null | novaclient/v1_1/volumes.py | sivel/python-novaclient | 810857849ed32773c38df12785715f89d33e83af | [
"Apache-1.1"
] | null | null | null | # Copyright 2011 Denali Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 34.180723 | 78 | 0.605217 |
import six
from novaclient import base
from novaclient.openstack.common.py3kcompat import urlutils
class Volume(base.Resource):
NAME_ATTR = 'display_name'
def __repr__(self):
return "<Volume: %s>" % self.id
def delete(self):
self.manager.delete(self)
class VolumeManager(base.Manager... | true | true |
1c47922da6f61b01101caee74d5b39091250523f | 5,778 | py | Python | deepspeech_pytorch/validation.py | RaphaelOlivier/deepspeech.pytorch | eb73ef61807ab01fad3662ad03dfea8fd44439aa | [
"MIT"
] | 1 | 2021-08-07T07:12:40.000Z | 2021-08-07T07:12:40.000Z | deepspeech_pytorch/validation.py | RaphaelOlivier/deepspeech.pytorch | eb73ef61807ab01fad3662ad03dfea8fd44439aa | [
"MIT"
] | 1 | 2019-02-07T12:52:46.000Z | 2019-02-07T12:52:46.000Z | deepspeech_pytorch/validation.py | RaphaelOlivier/deepspeech.pytorch | eb73ef61807ab01fad3662ad03dfea8fd44439aa | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
import torch
from torch.cuda.amp import autocast
from tqdm import tqdm
from deepspeech_pytorch.decoder import Decoder, GreedyDecoder
from pytorch_lightning.metrics import Metric
import Levenshtein as Lev
class ErrorRate(Metric, ABC):
def __init__(self,
decod... | 33.789474 | 81 | 0.602631 | from abc import ABC, abstractmethod
import torch
from torch.cuda.amp import autocast
from tqdm import tqdm
from deepspeech_pytorch.decoder import Decoder, GreedyDecoder
from pytorch_lightning.metrics import Metric
import Levenshtein as Lev
class ErrorRate(Metric, ABC):
def __init__(self,
decod... | true | true |
1c479507647de6ce6ea1f9c6b660694c87468544 | 4,167 | py | Python | polish/utils/host_call_fn.py | kinoute/google-research | 4a59cab927579ea9722e43252c695de5da4eb5e2 | [
"Apache-2.0"
] | 11 | 2020-01-29T07:25:04.000Z | 2022-03-05T16:01:21.000Z | polish/utils/host_call_fn.py | RubensZimbres/google-research | 562c7c6ef959cb3cb382b1b660ccc45e8f5289c4 | [
"Apache-2.0"
] | 13 | 2020-01-28T22:19:53.000Z | 2022-02-10T00:39:26.000Z | polish/utils/host_call_fn.py | RubensZimbres/google-research | 562c7c6ef959cb3cb382b1b660ccc45e8f5289c4 | [
"Apache-2.0"
] | 2 | 2020-02-27T11:09:49.000Z | 2021-08-25T07:32:15.000Z | # coding=utf-8
# Copyright 2019 The Google Research 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 by applicab... | 36.552632 | 78 | 0.708903 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gin
import tensorflow as tf
from tensorflow.contrib import summary as contrib_summary
@gin.configurable
def build_host_call_fn_every_n_global_steps(
params,
names_and_tensors,
n,
summar... | true | true |
1c47967d6dc098c03dfcc9f615566eb99f55f87c | 78,681 | py | Python | src/transformers/modeling_tf_utils.py | holazzer/transformers | 53191d75ecca21c028077b3227f9ac47379e4690 | [
"Apache-2.0"
] | 9 | 2021-07-31T12:02:20.000Z | 2021-09-21T00:40:43.000Z | src/transformers/modeling_tf_utils.py | holazzer/transformers | 53191d75ecca21c028077b3227f9ac47379e4690 | [
"Apache-2.0"
] | null | null | null | src/transformers/modeling_tf_utils.py | holazzer/transformers | 53191d75ecca21c028077b3227f9ac47379e4690 | [
"Apache-2.0"
] | 1 | 2021-10-01T05:32:22.000Z | 2021-10-01T05:32:22.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, 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 cop... | 45.192993 | 167 | 0.63202 |
import functools
import inspect
import os
import re
import warnings
from typing import Dict, List, Optional, Union
import h5py
import numpy as np
import tensorflow as tf
from tensorflow.python.keras import backend as K
from tensorflow.python.keras.saving import hdf5_format
from .configuration_utils import Pretrained... | true | true |
1c47973c175cf48b3b9eebccc97189614023378a | 3,319 | py | Python | zerver/lib/sessions.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 1 | 2020-03-17T14:58:50.000Z | 2020-03-17T14:58:50.000Z | zerver/lib/sessions.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | null | null | null | zerver/lib/sessions.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | null | null | null | import logging
from datetime import timedelta
from django.conf import settings
from django.contrib.auth import SESSION_KEY, get_user_model
from django.contrib.sessions.models import Session
from django.utils.timezone import now as timezone_now
from importlib import import_module
from typing import Any, List, Mapping, ... | 40.975309 | 108 | 0.730642 | import logging
from datetime import timedelta
from django.conf import settings
from django.contrib.auth import SESSION_KEY, get_user_model
from django.contrib.sessions.models import Session
from django.utils.timezone import now as timezone_now
from importlib import import_module
from typing import Any, List, Mapping, ... | true | true |
1c47973f15053c421fd0ceb6b824666a3ce5fbc4 | 50,742 | py | Python | Funções Analíticas/Virtualenv/Lib/site-packages/matplotlib/__init__.py | Leonardo-Maciel/PSO_Maciel | 3939448da45716260f3ac7811afdd13be670f346 | [
"MIT"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | Funções Analíticas/Virtualenv/Lib/site-packages/matplotlib/__init__.py | Leonardo-Maciel/PSO_Maciel | 3939448da45716260f3ac7811afdd13be670f346 | [
"MIT"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | Funções Analíticas/Virtualenv/Lib/site-packages/matplotlib/__init__.py | Leonardo-Maciel/PSO_Maciel | 3939448da45716260f3ac7811afdd13be670f346 | [
"MIT"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | """
An object-oriented plotting library.
A procedural interface is provided by the companion pyplot module,
which may be imported directly, e.g.::
import matplotlib.pyplot as plt
or using ipython::
ipython
at your terminal, followed by::
In [1]: %matplotlib
In [2]: import matplotlib.pyplot as plt
... | 34.192722 | 79 | 0.619566 |
import atexit
from collections import namedtuple
from collections.abc import MutableMapping
import contextlib
from distutils.version import LooseVersion
import functools
import importlib
import inspect
from inspect import Parameter
import locale
import logging
import os
from pathlib import Path
import pprint
import re... | true | true |
1c4797802e5895313ae0514ecdda3acd949bd084 | 6,958 | py | Python | Lib/objc/CoreTelephony.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 701 | 2018-10-22T11:54:09.000Z | 2022-03-31T14:39:30.000Z | Lib/objc/CoreTelephony.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 229 | 2018-10-24T09:15:31.000Z | 2021-12-24T16:51:37.000Z | Lib/objc/CoreTelephony.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 131 | 2018-11-25T18:33:03.000Z | 2022-03-24T03:18:07.000Z | """
Classes from the 'CoreTelephony' framework.
"""
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
MuxNotificationSink = _Class("MuxNotificationSink")
Co... | 47.333333 | 87 | 0.841765 |
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
MuxNotificationSink = _Class("MuxNotificationSink")
CoreTelephonyClientRemoteAsyncProxy = _Class("CoreTele... | true | true |
1c4798111c6d8c070c9d6fc6c731414b5eeea115 | 34 | py | Python | main/views/admin/profile/__init__.py | tiberiucorbu/av-website | f26f44a367d718316442506b130a7034697670b8 | [
"MIT"
] | null | null | null | main/views/admin/profile/__init__.py | tiberiucorbu/av-website | f26f44a367d718316442506b130a7034697670b8 | [
"MIT"
] | null | null | null | main/views/admin/profile/__init__.py | tiberiucorbu/av-website | f26f44a367d718316442506b130a7034697670b8 | [
"MIT"
] | null | null | null | from .profile_controller import *
| 17 | 33 | 0.823529 | from .profile_controller import *
| true | true |
1c4799987b867024deedfd8f407f6c7f0bdfb743 | 1,772 | py | Python | keylime/tornado_requests.py | ansasaki/keylime | 6aeb105975e8f2b3e9c83417dcf69b25dc2d69e4 | [
"Apache-2.0"
] | null | null | null | keylime/tornado_requests.py | ansasaki/keylime | 6aeb105975e8f2b3e9c83417dcf69b25dc2d69e4 | [
"Apache-2.0"
] | null | null | null | keylime/tornado_requests.py | ansasaki/keylime | 6aeb105975e8f2b3e9c83417dcf69b25dc2d69e4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import ssl
from tornado import httpclient
from keylime import json
async def request(method, url, params=None, data=None, context=None, headers=None):
http_client = httpclient.AsyncHTTPCli... | 28.580645 | 83 | 0.586907 |
import ssl
from tornado import httpclient
from keylime import json
async def request(method, url, params=None, data=None, context=None, headers=None):
http_client = httpclient.AsyncHTTPClient()
if params is not None and len(list(params.keys())) > 0:
url += '?'
for key in list(params.keys(... | true | true |
1c479a27833091f86e7dce2d076b0b29113122e0 | 1,190 | py | Python | rgbContrast.py | tsarjak/gsoc_code_library | 961cea8e0833d28e5c78e7dd06f7c3823b38cbfb | [
"MIT"
] | null | null | null | rgbContrast.py | tsarjak/gsoc_code_library | 961cea8e0833d28e5c78e7dd06f7c3823b38cbfb | [
"MIT"
] | null | null | null | rgbContrast.py | tsarjak/gsoc_code_library | 961cea8e0833d28e5c78e7dd06f7c3823b38cbfb | [
"MIT"
] | null | null | null | import cv2
from PIL import Image
import numpy as np
def arrayToImage(img,sizeX,sizeY,saveAs):
rgbArray = np.zeros((sizeX,sizeY,3),'uint8')
for i in range(0,sizeX):
for j in range(0,sizeY):
for k in range(0,3):
rgbArray[i,j,k] = img[i,j,k] * 255
img = Image.fromarray(rg... | 25.869565 | 65 | 0.544538 | import cv2
from PIL import Image
import numpy as np
def arrayToImage(img,sizeX,sizeY,saveAs):
rgbArray = np.zeros((sizeX,sizeY,3),'uint8')
for i in range(0,sizeX):
for j in range(0,sizeY):
for k in range(0,3):
rgbArray[i,j,k] = img[i,j,k] * 255
img = Image.fromarray(rg... | true | true |
1c479cab6063cd842005ff2b64e355a6610808bd | 31,229 | py | Python | fstunes/__init__.py | raxod502/fstunes | d54860ba1a709ce75855e6897d7f8019ecb92640 | [
"MIT"
] | 1 | 2019-05-03T04:08:17.000Z | 2019-05-03T04:08:17.000Z | fstunes/__init__.py | raxod502/fstunes | d54860ba1a709ce75855e6897d7f8019ecb92640 | [
"MIT"
] | null | null | null | fstunes/__init__.py | raxod502/fstunes | d54860ba1a709ce75855e6897d7f8019ecb92640 | [
"MIT"
] | null | null | null | import argparse
import bisect
import collections
import math
import mutagen
import os
import pathlib
import random
import re
import shutil
import string
import sys
def has_duplicates(l):
return len(l) != len(set(l))
def iter_len(iterable):
return sum(1 for _ in iterable)
def plural(n):
return "s" if n !=... | 36.957396 | 79 | 0.573666 | import argparse
import bisect
import collections
import math
import mutagen
import os
import pathlib
import random
import re
import shutil
import string
import sys
def has_duplicates(l):
return len(l) != len(set(l))
def iter_len(iterable):
return sum(1 for _ in iterable)
def plural(n):
return "s" if n !=... | true | true |
1c479d15f72832953af2ac415b7d3ec3543095c2 | 1,214 | py | Python | setup.py | DanielR59/mljar-supervised | 04a90ffbff33b2c93a7c212825b987e73b7f62fe | [
"MIT"
] | null | null | null | setup.py | DanielR59/mljar-supervised | 04a90ffbff33b2c93a7c212825b987e73b7f62fe | [
"MIT"
] | null | null | null | setup.py | DanielR59/mljar-supervised | 04a90ffbff33b2c93a7c212825b987e73b7f62fe | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="mljar-supervised",
v... | 30.35 | 81 | 0.644152 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="mljar-supervised",
version="0.11.2",
description="Automated Mach... | true | true |
1c479d38ba2d385729e4a2e779104cd41110084d | 1,146 | py | Python | tekstovni_vmesnik.py | kavcicm/Vislice | 04c3c09bad456321ee9da04c6af8deaeaa509842 | [
"MIT"
] | null | null | null | tekstovni_vmesnik.py | kavcicm/Vislice | 04c3c09bad456321ee9da04c6af8deaeaa509842 | [
"MIT"
] | null | null | null | tekstovni_vmesnik.py | kavcicm/Vislice | 04c3c09bad456321ee9da04c6af8deaeaa509842 | [
"MIT"
] | null | null | null | import model
lojtrice = "#############################\n"
def izpis_zmage(igra):
tekst = lojtrice + "Uganili ste geslo {0}.\n".format(igra.geslo)
return tekst
def izpis_poraza(igra):
tekst = lojtrice + "Obešeni ste! Pravilno geslo je blio {0}.\n".format(igra.geslo)
return tekst
def izpis_igre(igra):
... | 26.651163 | 86 | 0.579407 | import model
lojtrice = "#############################\n"
def izpis_zmage(igra):
tekst = lojtrice + "Uganili ste geslo {0}.\n".format(igra.geslo)
return tekst
def izpis_poraza(igra):
tekst = lojtrice + "Obešeni ste! Pravilno geslo je blio {0}.\n".format(igra.geslo)
return tekst
def izpis_igre(igra):
... | true | true |
1c479e4d6b65a786785934f82983844d7a1b5553 | 443 | py | Python | run_blast.py | denkovarik/EC-Scrape | e6340fe852b204f4813ec6ede4d20138a85644b6 | [
"MIT"
] | null | null | null | run_blast.py | denkovarik/EC-Scrape | e6340fe852b204f4813ec6ede4d20138a85644b6 | [
"MIT"
] | null | null | null | run_blast.py | denkovarik/EC-Scrape | e6340fe852b204f4813ec6ede4d20138a85644b6 | [
"MIT"
] | null | null | null | import sys, os, time
from utils import *
import shutil
from run_blast_utils import *
blast_rslt_dir = 'blast_rslts\\'
blast_working_dir = 'temp_blast\\'
commands = []
args = parse_args(sys.argv)
# Compile command line arguments
commands = compile_cmd(args, blast_rslt_dir, blast_working_dir)
start_time = t... | 24.611111 | 63 | 0.740406 | import sys, os, time
from utils import *
import shutil
from run_blast_utils import *
blast_rslt_dir = 'blast_rslts\\'
blast_working_dir = 'temp_blast\\'
commands = []
args = parse_args(sys.argv)
commands = compile_cmd(args, blast_rslt_dir, blast_working_dir)
start_time = time.time()
exec_commands(commands... | true | true |
1c479e5971d949fcf67c534f48a3d16b3e4c4a28 | 2,063 | py | Python | zfused_maya/zfused_maya/core/color.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | 2 | 2019-02-22T03:33:26.000Z | 2019-02-23T03:29:26.000Z | zfused_maya/zfused_maya/core/color.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | null | null | null | zfused_maya/zfused_maya/core/color.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
# --author-- lanhua.zhou
import os
import json
import logging
__all__ = ["get_component_color_data", "LetterColor"]
DIRNAME = os.path.dirname(__file__)
MENU_DIRNAME = os.path.dirname(os.path.dirname(DIRNAME))
COMPONENT_COLOR_FILE = "{}/conf/componentcolor.json".format(MENU_DIRNAME)
logger = logging.ge... | 25.158537 | 73 | 0.492002 | import os
import json
import logging
__all__ = ["get_component_color_data", "LetterColor"]
DIRNAME = os.path.dirname(__file__)
MENU_DIRNAME = os.path.dirname(os.path.dirname(DIRNAME))
COMPONENT_COLOR_FILE = "{}/conf/componentcolor.json".format(MENU_DIRNAME)
logger = logging.getLogger(__name__)
def get_component_col... | true | true |
1c479e9907ca8ed897efe7210ee012940850571b | 181 | py | Python | DJANGO PROJECT/Configurator/ConfigWebApp/forms.py | BobbyElmes/Fusion-Configurator-Source-Code | 08e6c14789a2e8d073b312422ce893ee463369f5 | [
"MIT"
] | null | null | null | DJANGO PROJECT/Configurator/ConfigWebApp/forms.py | BobbyElmes/Fusion-Configurator-Source-Code | 08e6c14789a2e8d073b312422ce893ee463369f5 | [
"MIT"
] | null | null | null | DJANGO PROJECT/Configurator/ConfigWebApp/forms.py | BobbyElmes/Fusion-Configurator-Source-Code | 08e6c14789a2e8d073b312422ce893ee463369f5 | [
"MIT"
] | null | null | null | from django import forms
class Register(forms.Form):
username = forms.CharField(label='username', max_length=35)
password = forms.CharField(label='password', max_length=35) | 36.2 | 63 | 0.756906 | from django import forms
class Register(forms.Form):
username = forms.CharField(label='username', max_length=35)
password = forms.CharField(label='password', max_length=35) | true | true |
1c479fcc08d0b2f40c0963da403abaa4ff01ae81 | 4,853 | py | Python | qa/rpc-tests/httpbasics.py | PapicoinProject/Papicoin | c971fcd1f81d07fe9de2e2c3893f362d9a8529f5 | [
"MIT"
] | 1 | 2022-03-19T16:50:57.000Z | 2022-03-19T16:50:57.000Z | qa/rpc-tests/httpbasics.py | PapicoinProject/Papicoin | c971fcd1f81d07fe9de2e2c3893f362d9a8529f5 | [
"MIT"
] | null | null | null | qa/rpc-tests/httpbasics.py | PapicoinProject/Papicoin | c971fcd1f81d07fe9de2e2c3893f362d9a8529f5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2022 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test rpc http basics
#
from test_framework.test_framework import BitcoinTestFramework
from test_fram... | 42.570175 | 108 | 0.632186 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import http.client
import urllib.parse
class HTTPBasicsTest (BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 3
self.setup_clean_chain = False
def setup_net... | true | true |
1c47a0df09096f9bfb11acb7116db2b3e4c3ba4a | 1,076 | py | Python | api/views.py | masoodmomin/django-react-todoapp | 06fb4f7603bba726e6b0b13cf7dfc5e0aa068f0c | [
"MIT"
] | 1 | 2020-12-06T12:32:23.000Z | 2020-12-06T12:32:23.000Z | api/views.py | masoodmomin/django-react-todoapp | 06fb4f7603bba726e6b0b13cf7dfc5e0aa068f0c | [
"MIT"
] | null | null | null | api/views.py | masoodmomin/django-react-todoapp | 06fb4f7603bba726e6b0b13cf7dfc5e0aa068f0c | [
"MIT"
] | null | null | null | from django.http import request
from django.shortcuts import render
from rest_framework.decorators import api_view
from rest_framework.response import Response
from .serializers import TodoSerializer
from .models import Todo
from django.http import JsonResponse
@api_view(['GET'])
def all(request):
todo = Todo.obje... | 29.081081 | 66 | 0.727695 | from django.http import request
from django.shortcuts import render
from rest_framework.decorators import api_view
from rest_framework.response import Response
from .serializers import TodoSerializer
from .models import Todo
from django.http import JsonResponse
@api_view(['GET'])
def all(request):
todo = Todo.obje... | true | true |
1c47a10742a03a90e69f50b632ec06af813dc613 | 18,268 | py | Python | core/controllers/suggestion.py | ReshuKumari/oppia | cb89b633275b3d0b2d02e0d22e0c472d8b8da0e1 | [
"Apache-2.0"
] | null | null | null | core/controllers/suggestion.py | ReshuKumari/oppia | cb89b633275b3d0b2d02e0d22e0c472d8b8da0e1 | [
"Apache-2.0"
] | null | null | null | core/controllers/suggestion.py | ReshuKumari/oppia | cb89b633275b3d0b2d02e0d22e0c472d8b8da0e1 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 39.117773 | 80 | 0.661047 |
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
from constants import constants
from core.controllers import acl_decorators
from core.controllers import base
from core.domain import fs_services
from core.domain import html_cleaner
from core.domain import image_validatio... | true | true |
1c47a212af9aebe31a9460335ed92e68251a9076 | 3,160 | py | Python | Exec/testing/Viscous-Vortex/check.py | darylbond/cerberus | a1b99f6b50ba6876d4705f26e6be98ed6e1c5c6a | [
"MIT"
] | 5 | 2021-05-10T01:21:52.000Z | 2022-03-10T17:26:41.000Z | Exec/testing/Viscous-Vortex/check.py | darylbond/cerberus | a1b99f6b50ba6876d4705f26e6be98ed6e1c5c6a | [
"MIT"
] | 3 | 2021-05-26T01:12:12.000Z | 2021-12-14T00:34:06.000Z | Exec/testing/Viscous-Vortex/check.py | darylbond/cerberus | a1b99f6b50ba6876d4705f26e6be98ed6e1c5c6a | [
"MIT"
] | 3 | 2021-05-11T02:45:27.000Z | 2021-09-06T12:08:23.000Z |
import sys
cmd_folder = "../../../vis"
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
from get_boxlib import ReadBoxLib, get_files
import numpy as np
import pylab as plt
import matplotlib.ticker as ticker
def check():
#=====================================================================... | 27.241379 | 92 | 0.472468 |
import sys
cmd_folder = "../../../vis"
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
from get_boxlib import ReadBoxLib, get_files
import numpy as np
import pylab as plt
import matplotlib.ticker as ticker
def check():
files = get_files('.', include=['plt'], exclude=["tem... | true | true |
1c47a21bcb817eb9aae5fdc55c17b7fec9d7bcef | 1,310 | py | Python | auger_cli/commands/experiment_sessions.py | deeplearninc/auger-cli | afa52224043834e11f40d69d2042d53dfccc5ae5 | [
"MIT"
] | 1 | 2019-04-17T12:40:58.000Z | 2019-04-17T12:40:58.000Z | auger_cli/commands/experiment_sessions.py | deeplearninc/auger-cli | afa52224043834e11f40d69d2042d53dfccc5ae5 | [
"MIT"
] | 25 | 2019-03-06T08:20:04.000Z | 2019-07-07T06:00:20.000Z | auger_cli/commands/experiment_sessions.py | deeplearninc/auger-cli | afa52224043834e11f40d69d2042d53dfccc5ae5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import click
from auger_cli.cli_client import pass_client
from auger_cli.formatter import (
print_list,
print_record,
print_table
)
from auger_cli.api import experiment_sessions
@click.group(
'experiment_sessions',
invoke_without_command=True,
short_help='Manage Auge... | 24.716981 | 117 | 0.714504 |
import click
from auger_cli.cli_client import pass_client
from auger_cli.formatter import (
print_list,
print_record,
print_table
)
from auger_cli.api import experiment_sessions
@click.group(
'experiment_sessions',
invoke_without_command=True,
short_help='Manage Auger project experiment ses... | true | true |
1c47a2331be5ca842b9b76d50b82dda69ffca458 | 5,055 | py | Python | test/functional/test_framework/netutil.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | test/functional/test_framework/netutil.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | test/functional/test_framework/netutil.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Knotcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Linux network utilities.
Roughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-1... | 32.197452 | 111 | 0.600198 |
import sys
import socket
import fcntl
import struct
import array
import os
from binascii import unhexlify, hexlify
STATE_LISTEN = '0A'
def get_socket_inodes(pid):
base = '/proc/%i/fd' % pid
inodes = []
for item in os.listdir(base):
target = os.readlink(os.path.join(base, item))
if target.... | true | true |
1c47a240eda919b8a1cb429d2d0afedc165532f8 | 263 | py | Python | Statistics/randomNum.py | ssm29njit/calculator601SheethalJedidiah | 2812fbabcf5249eeee8a2f34edd6152cfa2d175e | [
"MIT"
] | 1 | 2020-11-08T05:11:27.000Z | 2020-11-08T05:11:27.000Z | Statistics/randomNum.py | ssm29njit/calculator601SheethalJedidiah | 2812fbabcf5249eeee8a2f34edd6152cfa2d175e | [
"MIT"
] | null | null | null | Statistics/randomNum.py | ssm29njit/calculator601SheethalJedidiah | 2812fbabcf5249eeee8a2f34edd6152cfa2d175e | [
"MIT"
] | 1 | 2020-12-09T15:37:51.000Z | 2020-12-09T15:37:51.000Z | from random import random
def getRandomNum(data,sample_size):
random_values = random.sample(data, k=sample_size-1)
return random_values
#def getSample(data, sample_size):
# random_values = random.sample(data, k=sample_size)
# return random_values | 26.3 | 56 | 0.760456 | from random import random
def getRandomNum(data,sample_size):
random_values = random.sample(data, k=sample_size-1)
return random_values
| true | true |
1c47a26a1e9d995623a6018575abb2f888b8d25f | 11,579 | py | Python | tests/learning/test_rumelhart_semantic_network.py | bdsinger/PsyNeuLink | 71d8a0bb1691ff85061d4ad3de866d9930a69a73 | [
"Apache-2.0"
] | null | null | null | tests/learning/test_rumelhart_semantic_network.py | bdsinger/PsyNeuLink | 71d8a0bb1691ff85061d4ad3de866d9930a69a73 | [
"Apache-2.0"
] | null | null | null | tests/learning/test_rumelhart_semantic_network.py | bdsinger/PsyNeuLink | 71d8a0bb1691ff85061d4ad3de866d9930a69a73 | [
"Apache-2.0"
] | null | null | null | import pytest
import psyneulink as pnl
import psyneulink.core.components.functions.transferfunctions
def validate_learning_mechs(sys):
def get_learning_mech(name):
return next(lm for lm in sys.learning_mechanisms if lm.name == name)
REP_IN_to_REP_HIDDEN_LM = get_learning_mech('LearningMechanism for ... | 62.589189 | 143 | 0.586925 | import pytest
import psyneulink as pnl
import psyneulink.core.components.functions.transferfunctions
def validate_learning_mechs(sys):
def get_learning_mech(name):
return next(lm for lm in sys.learning_mechanisms if lm.name == name)
REP_IN_to_REP_HIDDEN_LM = get_learning_mech('LearningMechanism for ... | true | true |
1c47a3c567eca3d2d1212e401d44eb434aeea753 | 124 | py | Python | blog/blog/api/urls.py | akiracadet/django-rest-sandbox | d5eb8667328b20b85b41b814e1071aad4627fac3 | [
"MIT"
] | null | null | null | blog/blog/api/urls.py | akiracadet/django-rest-sandbox | d5eb8667328b20b85b41b814e1071aad4627fac3 | [
"MIT"
] | 4 | 2021-04-08T19:39:29.000Z | 2021-09-22T19:33:36.000Z | blog/blog/api/urls.py | akiracadet/django-rest-sandbox | d5eb8667328b20b85b41b814e1071aad4627fac3 | [
"MIT"
] | null | null | null | from django.urls import include
from django.urls import path
urlpatterns = [
path('posts/', include('posts.urls')),
]
| 15.5 | 42 | 0.701613 | from django.urls import include
from django.urls import path
urlpatterns = [
path('posts/', include('posts.urls')),
]
| true | true |
1c47a4d77aa127fc90e8639b68a267f11d0041c2 | 403 | py | Python | bookshop_proj/asgi.py | ravenda900/bookshop-django | d66308a75c69854d55f8093aa8d35d4940cb5689 | [
"MIT"
] | null | null | null | bookshop_proj/asgi.py | ravenda900/bookshop-django | d66308a75c69854d55f8093aa8d35d4940cb5689 | [
"MIT"
] | null | null | null | bookshop_proj/asgi.py | ravenda900/bookshop-django | d66308a75c69854d55f8093aa8d35d4940cb5689 | [
"MIT"
] | null | null | null | """
ASGI config for bookshop_proj project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO... | 23.705882 | 78 | 0.791563 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bookshop_proj.settings')
application = get_asgi_application()
| true | true |
1c47a53589ababd0727d0971d389fb95baaeab43 | 4,168 | py | Python | research/minigo/evaluation.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/minigo/evaluation.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/minigo/evaluation.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.02521 | 80 | 0.669626 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import go
import sgf_wrapper
from gtp_wrapper import MCTSPlayer
def play_match(params, black_net, white_net, games, readouts,
sgf_dir, verbosity):
black = MCTSPlayer(... | true | true |
1c47a5a2c3724fb74c6a56157c990c41856f9b53 | 401 | py | Python | tweepy/error.py | skoczen/tweepy | 3b4bbabe1ecafee40d9d5942fbd59c4056c8997c | [
"MIT"
] | 24 | 2015-11-12T06:33:24.000Z | 2019-04-16T11:11:13.000Z | tweepy/error.py | skoczen/tweepy | 3b4bbabe1ecafee40d9d5942fbd59c4056c8997c | [
"MIT"
] | 3 | 2015-11-12T22:16:22.000Z | 2021-08-09T07:00:27.000Z | tweepy/error.py | skoczen/tweepy | 3b4bbabe1ecafee40d9d5942fbd59c4056c8997c | [
"MIT"
] | 7 | 2015-11-12T20:09:56.000Z | 2020-12-16T17:59:02.000Z | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from __future__ import print_function
import six
class TweepError(Exception):
"""Tweepy exception"""
def __init__(self, reason, response=None):
self.reason = six.text_type(reason)
self.response = response
Exc... | 20.05 | 46 | 0.693267 |
from __future__ import print_function
import six
class TweepError(Exception):
def __init__(self, reason, response=None):
self.reason = six.text_type(reason)
self.response = response
Exception.__init__(self, reason)
def __str__(self):
return self.reason
| true | true |
1c47a9283d75ce997bacf6c8e784da408d98f090 | 164 | py | Python | python/kyu-6/detect-pangram/test_detect_pangram.py | ledwindra/codewars | 0552669a69e801cfe5f9a3696a4d98be63a96951 | [
"WTFPL"
] | 1 | 2020-11-13T16:55:04.000Z | 2020-11-13T16:55:04.000Z | python/kyu-6/detect-pangram/test_detect_pangram.py | ledwindra/codewars | 0552669a69e801cfe5f9a3696a4d98be63a96951 | [
"WTFPL"
] | 1 | 2020-01-28T15:48:17.000Z | 2020-01-28T15:48:17.000Z | python/kyu-6/detect-pangram/test_detect_pangram.py | ledwindra/codewars | 0552669a69e801cfe5f9a3696a4d98be63a96951 | [
"WTFPL"
] | null | null | null | from detect_pangram import is_pangram
class TestPangram:
def test_0(self):
assert is_pangram('The quick, brown fox jumps over the lazy dog!') == True | 23.428571 | 82 | 0.719512 | from detect_pangram import is_pangram
class TestPangram:
def test_0(self):
assert is_pangram('The quick, brown fox jumps over the lazy dog!') == True | true | true |
1c47a928f0a5aff8aff873bfd002dda97fcd6bb1 | 15,931 | py | Python | notebooks/__code/metadata_overlapping_images/metadata_overlapping_images.py | ornlneutronimaging/notebooks | d219cdc9ec103fd8bb45891b984f45d3d6facecd | [
"BSD-3-Clause"
] | null | null | null | notebooks/__code/metadata_overlapping_images/metadata_overlapping_images.py | ornlneutronimaging/notebooks | d219cdc9ec103fd8bb45891b984f45d3d6facecd | [
"BSD-3-Clause"
] | null | null | null | notebooks/__code/metadata_overlapping_images/metadata_overlapping_images.py | ornlneutronimaging/notebooks | d219cdc9ec103fd8bb45891b984f45d3d6facecd | [
"BSD-3-Clause"
] | null | null | null | from IPython.core.display import HTML
from IPython.core.display import display
import os
import copy
from qtpy.QtWidgets import QMainWindow, QFileDialog
from qtpy import QtGui
from collections import OrderedDict
from __code import load_ui
from .initialization import Initializer
from .event_handler import MetadataTable... | 37.751185 | 102 | 0.612203 | from IPython.core.display import HTML
from IPython.core.display import display
import os
import copy
from qtpy.QtWidgets import QMainWindow, QFileDialog
from qtpy import QtGui
from collections import OrderedDict
from __code import load_ui
from .initialization import Initializer
from .event_handler import MetadataTable... | true | true |
1c47a9ba768369e5fcda639a537396d54a754795 | 142 | py | Python | mysite/users/apps.py | saademad200/SE_Visualri | f01e22a5e47a44eb9219199027b68d1bd0bb4bca | [
"BSL-1.0"
] | null | null | null | mysite/users/apps.py | saademad200/SE_Visualri | f01e22a5e47a44eb9219199027b68d1bd0bb4bca | [
"BSL-1.0"
] | null | null | null | mysite/users/apps.py | saademad200/SE_Visualri | f01e22a5e47a44eb9219199027b68d1bd0bb4bca | [
"BSL-1.0"
] | null | null | null | from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'users'
def ready(self):
import users.signals
| 17.75 | 34 | 0.65493 | from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'users'
def ready(self):
import users.signals
| true | true |
1c47aaec11d06eff56c121c77fb592d8b28a697b | 13,676 | py | Python | tornado/autoreload.py | DengJackNo1/tornado | 895a4fa69817c24fbf6ada6c5fb07351c6e91cd5 | [
"Apache-2.0"
] | 640 | 2018-09-12T03:14:13.000Z | 2022-03-30T04:38:09.000Z | tornado/autoreload.py | DengJackNo1/tornado | 895a4fa69817c24fbf6ada6c5fb07351c6e91cd5 | [
"Apache-2.0"
] | 242 | 2019-01-29T15:48:27.000Z | 2022-03-31T22:09:21.000Z | tornado/autoreload.py | DengJackNo1/tornado | 895a4fa69817c24fbf6ada6c5fb07351c6e91cd5 | [
"Apache-2.0"
] | 230 | 2018-09-13T02:40:49.000Z | 2022-03-29T11:53:58.000Z | #
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 37.468493 | 88 | 0.674101 |
import os
import sys
# original.
#
# Conversely, when run as path/to/file.py, the directory containing
# file.py gets added to the path, which can cause confusion as imports
# may become relative in spite of the future import.
#
# We address the former problem by reconstructing the original command
# line (Python >=... | true | true |
1c47ab394fb23448ceb4c13702c16990ae7535cf | 649 | py | Python | Ex056.py | andrade-lcs/ex_curso_em_video_python | f2d029efe7a20cdf0fcb5b602f9992e27d37c263 | [
"MIT"
] | null | null | null | Ex056.py | andrade-lcs/ex_curso_em_video_python | f2d029efe7a20cdf0fcb5b602f9992e27d37c263 | [
"MIT"
] | null | null | null | Ex056.py | andrade-lcs/ex_curso_em_video_python | f2d029efe7a20cdf0fcb5b602f9992e27d37c263 | [
"MIT"
] | null | null | null | m = int()
q = int()
ma = int()
mm = int()
me = float()
nma = str()
a = int(input('Digite quantas pessoas tem o Grupo: '))
for c in range(0, a):
n = str(input('Digite o nome: '))
i = int(input('Digite a idade: '))
s = int(input('Digite o sexo:\n[1] para masculino\n[2]para feminino\n'))
m = m + i
q = ... | 28.217391 | 118 | 0.534669 | m = int()
q = int()
ma = int()
mm = int()
me = float()
nma = str()
a = int(input('Digite quantas pessoas tem o Grupo: '))
for c in range(0, a):
n = str(input('Digite o nome: '))
i = int(input('Digite a idade: '))
s = int(input('Digite o sexo:\n[1] para masculino\n[2]para feminino\n'))
m = m + i
q = ... | true | true |
1c47ac62262bb7d3b7efc480a2952496dfd81d53 | 571 | py | Python | core/da/sqlitedriver.py | ramkj/xman | 8ab14b0754e0ef3c44c27259c0df7c10697d3502 | [
"Apache-2.0"
] | null | null | null | core/da/sqlitedriver.py | ramkj/xman | 8ab14b0754e0ef3c44c27259c0df7c10697d3502 | [
"Apache-2.0"
] | null | null | null | core/da/sqlitedriver.py | ramkj/xman | 8ab14b0754e0ef3c44c27259c0df7c10697d3502 | [
"Apache-2.0"
] | null | null | null | import sqlite3
class SQLiteDriver:
def __init__(self, dbname: str ):
self.config = dbname
def __enter__(self) -> 'cursor':
self.connection = sqlite3.connect(self.config)
assert self.connection is not None, 'failed getting connection from DB'
self.connection.execute( 'PRAGMA f... | 30.052632 | 79 | 0.654991 | import sqlite3
class SQLiteDriver:
def __init__(self, dbname: str ):
self.config = dbname
def __enter__(self) -> 'cursor':
self.connection = sqlite3.connect(self.config)
assert self.connection is not None, 'failed getting connection from DB'
self.connection.execute( 'PRAGMA f... | true | true |
1c47ac976cbf51fb5ea1439ce4c43e00aa534a40 | 1,027 | py | Python | salt/runners/mine.py | bruce-one/salt | 0715f6c29a8e19c3cf7a67ad41aff84801c9f5ae | [
"Apache-2.0"
] | 1 | 2016-04-20T08:18:07.000Z | 2016-04-20T08:18:07.000Z | salt/runners/mine.py | quantonganh/salt | 8f1df678573153970c08b33978fe185d9ed1b71c | [
"Apache-2.0"
] | null | null | null | salt/runners/mine.py | quantonganh/salt | 8f1df678573153970c08b33978fe185d9ed1b71c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
A runner to access data from the salt mine
'''
# Import python libs
import os
# Import salt libs
import salt.payload
import salt.utils.minions
import salt.utils
def get(tgt, fun, tgt_type='glob'):
'''
Gathers the data from the specified minions' mine, pass in the target,
funct... | 23.883721 | 74 | 0.558909 | import os
import salt.payload
import salt.utils.minions
import salt.utils
def get(tgt, fun, tgt_type='glob'):
ret = {}
serial = salt.payload.Serial(__opts__)
checker = salt.utils.minions.CkMinions(__opts__)
minions = checker.check_minions(
tgt,
tgt_type)
for minion in mini... | true | true |
1c47ade190e28d7400249b8c5dab37fe86d3fefc | 1,489 | py | Python | parser/team08/Tytus_SQLPARSER_G8/Instrucciones/FunctionTrigonometric/Tanh.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | parser/team08/Tytus_SQLPARSER_G8/Instrucciones/FunctionTrigonometric/Tanh.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | parser/team08/Tytus_SQLPARSER_G8/Instrucciones/FunctionTrigonometric/Tanh.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | import math
from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.TablaSimbolos.Tipo import Tipo_Dato, Tipo
from Instrucciones.Excepcion import Excepcion
class Tanh(Instruccion):
def __init__(self, valor, strGram, linea, columna):
Instruccion.__init__(self,Tipo(Tipo_Dato.DOUBLE... | 55.148148 | 335 | 0.697112 | import math
from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.TablaSimbolos.Tipo import Tipo_Dato, Tipo
from Instrucciones.Excepcion import Excepcion
class Tanh(Instruccion):
def __init__(self, valor, strGram, linea, columna):
Instruccion.__init__(self,Tipo(Tipo_Dato.DOUBLE... | true | true |
1c47ae46f17c882072873a49257d173aa670600d | 6,395 | py | Python | examples/benchmarks/json/errors.py | eerimoq/textparser | cc4a85f8b7e6d6be83f5072f45af4a7baf6c35df | [
"MIT"
] | 23 | 2018-09-01T14:39:07.000Z | 2021-11-08T11:52:43.000Z | examples/benchmarks/json/errors.py | risingdeveloper007/TextParser | c0f7b0268f86b77f4eb8366016987140792faff8 | [
"MIT"
] | 1 | 2020-07-06T13:19:25.000Z | 2020-08-01T08:16:34.000Z | examples/benchmarks/json/errors.py | risingdeveloper007/TextParser | c0f7b0268f86b77f4eb8366016987140792faff8 | [
"MIT"
] | 6 | 2019-05-01T21:31:03.000Z | 2021-08-24T11:57:21.000Z | #!/usr/bin/env python
"""Parse error comparsion for a few JSON parsers.
Example execution:
$ env PYTHONPATH=. python3 examples/benchmarks/json/errors.py
-----------------------------------------------------------------
Input string between BEGIN and END:
BEGIN
END
textparser: "Invalid syntax at line 1, column 1: ... | 25.682731 | 283 | 0.602033 |
from __future__ import print_function
from parsers import textparser_json
from parsers import lark_json
from parsers import pyparsing_json
from parsers import funcparserlib_json
from parsers import parsimonious_json
from parsers import textx_json
try:
from parsers import parsita_json
except:
class parsita_... | true | true |
1c47af64e57d9e011aed97ff68c6f130de74836b | 1,067 | py | Python | setup.py | timmypidashev/poilet | 40535f9d22f1722de130458e9e487a945abd653f | [
"MIT"
] | null | null | null | setup.py | timmypidashev/poilet | 40535f9d22f1722de130458e9e487a945abd653f | [
"MIT"
] | null | null | null | setup.py | timmypidashev/poilet | 40535f9d22f1722de130458e9e487a945abd653f | [
"MIT"
] | null | null | null | import re
from setuptools import setup
# README will be shown on PyPi
with open('README.md') as file:
readme = file.read()
# Track version number
with open('poilet/__init__.py') as file:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', file.read(), re.MULTILINE)
setup(
name='poilet',
au... | 30.485714 | 93 | 0.645736 | import re
from setuptools import setup
with open('README.md') as file:
readme = file.read()
with open('poilet/__init__.py') as file:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', file.read(), re.MULTILINE)
setup(
name='poilet',
author='timmypidashev',
url='https://github.com/timm... | true | true |
1c47affeae4e58845137235341df557f0710b03f | 50,416 | py | Python | mypy/main.py | noudald/mypy | ecdd4b2e81945d998eb1e1116fb901ff7b63a703 | [
"PSF-2.0"
] | null | null | null | mypy/main.py | noudald/mypy | ecdd4b2e81945d998eb1e1116fb901ff7b63a703 | [
"PSF-2.0"
] | null | null | null | mypy/main.py | noudald/mypy | ecdd4b2e81945d998eb1e1116fb901ff7b63a703 | [
"PSF-2.0"
] | null | null | null | """Mypy type checker command line tool."""
import argparse
import ast
import configparser
import os
import re
import subprocess
import sys
import time
from typing import Any, Dict, List, Mapping, Optional, Tuple, Callable
from mypy import build
from mypy import defaults
from mypy import experiments
from mypy import ... | 45.708069 | 99 | 0.623433 |
import argparse
import ast
import configparser
import os
import re
import subprocess
import sys
import time
from typing import Any, Dict, List, Mapping, Optional, Tuple, Callable
from mypy import build
from mypy import defaults
from mypy import experiments
from mypy import util
from mypy.build import BuildResult
fro... | true | true |
1c47b20f4f8dc841c057a6f528ecd4be3beca08f | 10,390 | py | Python | wbb/modules/misc.py | TAMILVIP007/WilliamButcherBot | e7a02edcd57ec62c7f80c601484e92e257e1d5bf | [
"MIT"
] | 1 | 2021-06-30T07:09:45.000Z | 2021-06-30T07:09:45.000Z | wbb/modules/misc.py | fakeenemy01/GroupBot | e7a02edcd57ec62c7f80c601484e92e257e1d5bf | [
"MIT"
] | null | null | null | wbb/modules/misc.py | fakeenemy01/GroupBot | e7a02edcd57ec62c7f80c601484e92e257e1d5bf | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2021 TheHamkerCat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... | 33.516129 | 145 | 0.64052 | import secrets
import string
import aiohttp
from cryptography.fernet import Fernet
from pyrogram import filters
from wbb import FERNET_ENCRYPTION_KEY, app, arq
from wbb.core.decorators.errors import capture_err
from wbb.utils import random_line
from wbb.utils.fetch import fetch
from wbb.utils.json_prettify import jso... | true | true |
1c47b21893ab3220005fe7fa5a3318ed874a4750 | 592 | py | Python | python/tests/test_merge_sort.py | YahyaOmari/data-structures-and-algorithms | 86c1bc892ef3b62238555548f460065ac24c5ce3 | [
"MIT"
] | null | null | null | python/tests/test_merge_sort.py | YahyaOmari/data-structures-and-algorithms | 86c1bc892ef3b62238555548f460065ac24c5ce3 | [
"MIT"
] | 1 | 2021-05-04T21:33:34.000Z | 2021-05-04T21:33:34.000Z | python/tests/test_merge_sort.py | YahyaOmari/data-structures-and-algorithms | 86c1bc892ef3b62238555548f460065ac24c5ce3 | [
"MIT"
] | null | null | null | import pytest
from challenges.merge_sort.merge_sort import merge_sort
def test_merge_sort():
actual = merge_sort([5,2,6,0])
excpected = [0, 2, 5, 6]
assert excpected == actual
def test_merge_sort2():
actual = merge_sort([20,18,12,8,5,-2])
excpected = [-2, 5, 8, 12, 18, 20]
assert excpected == ... | 26.909091 | 55 | 0.636824 | import pytest
from challenges.merge_sort.merge_sort import merge_sort
def test_merge_sort():
actual = merge_sort([5,2,6,0])
excpected = [0, 2, 5, 6]
assert excpected == actual
def test_merge_sort2():
actual = merge_sort([20,18,12,8,5,-2])
excpected = [-2, 5, 8, 12, 18, 20]
assert excpected == ... | true | true |
1c47b32f4ca4a9f1fa63baf4c55c2e109438b7d7 | 3,730 | py | Python | pychron/dashboard/process_value.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 31 | 2016-03-07T02:38:17.000Z | 2022-02-14T18:23:43.000Z | pychron/dashboard/process_value.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 1,626 | 2015-01-07T04:52:35.000Z | 2022-03-25T19:15:59.000Z | pychron/dashboard/process_value.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 26 | 2015-05-23T00:10:06.000Z | 2022-03-07T16:51:57.000Z | # ===============================================================================
# Copyright 2014 Jake Ross
#
# 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... | 32.434783 | 90 | 0.531635 |
from __future__ import absolute_import
import time
from traits.api import HasTraits, Str, Either, Property, Float, Int, Bool, List, Enum
from traitsui.api import (
View,
VGroup,
HGroup,
UItem,
ListEditor,
InstanceEditor,
Readonly,
)
from pychron.core.helpers.datetime_tools import convert_... | true | true |
1c47b4039bfa2cc4e0a27db2b332508a8ada0804 | 1,964 | py | Python | facelib/InsightFace/models/data/data_pipe.py | ffletcherr/FaceLib | fc1b8496f90ba2c6a76bfb8a59e2e2af7a439a63 | [
"MIT"
] | null | null | null | facelib/InsightFace/models/data/data_pipe.py | ffletcherr/FaceLib | fc1b8496f90ba2c6a76bfb8a59e2e2af7a439a63 | [
"MIT"
] | null | null | null | facelib/InsightFace/models/data/data_pipe.py | ffletcherr/FaceLib | fc1b8496f90ba2c6a76bfb8a59e2e2af7a439a63 | [
"MIT"
] | null | null | null | from torch.utils.data import Dataset, ConcatDataset, DataLoader
from torchvision import transforms as trans
from torchvision.datasets import ImageFolder
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
import numpy as np
def de_preprocess(tensor):
return tensor * 0.5 + 0.5
def get_train_dataset... | 34.45614 | 97 | 0.679735 | from torch.utils.data import Dataset, ConcatDataset, DataLoader
from torchvision import transforms as trans
from torchvision.datasets import ImageFolder
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
import numpy as np
def de_preprocess(tensor):
return tensor * 0.5 + 0.5
def get_train_dataset... | true | true |
1c47b4fbe727de9a582c4425c5640a77c610d033 | 588 | py | Python | Challenge 1/script.py | kutyel/tuenti-challenge-6 | 63b4f1843cc55c0d409dd610a3b297c276b63a83 | [
"MIT"
] | 1 | 2016-06-27T18:28:37.000Z | 2016-06-27T18:28:37.000Z | Challenge 1/script.py | kutyel/tuenti-challenge-6 | 63b4f1843cc55c0d409dd610a3b297c276b63a83 | [
"MIT"
] | null | null | null | Challenge 1/script.py | kutyel/tuenti-challenge-6 | 63b4f1843cc55c0d409dd610a3b297c276b63a83 | [
"MIT"
] | null | null | null | from __future__ import print_function
with open('output.txt', 'w') as output:
with open('submitInput.txt', 'r') as input_:
cases = int(input_.readline())
lines = input_.readlines()
for test, line in enumerate(lines):
result = 0
people = int(line)
... | 28 | 72 | 0.472789 | from __future__ import print_function
with open('output.txt', 'w') as output:
with open('submitInput.txt', 'r') as input_:
cases = int(input_.readline())
lines = input_.readlines()
for test, line in enumerate(lines):
result = 0
people = int(line)
... | true | true |
1c47b4fd441724e07fa4f7a33443a0d5dca4808b | 1,228 | py | Python | zclassifiershiftedae/prepare_data.py | VAShibaev/text_style_transfer | 42a4a653d7c47b5f04fe8c2b043f70a28b924e1f | [
"Apache-2.0"
] | 38 | 2019-09-05T16:39:19.000Z | 2022-03-07T18:04:06.000Z | zclassifiershiftedae/prepare_data.py | VAShibaev/text_style_transfer | 42a4a653d7c47b5f04fe8c2b043f70a28b924e1f | [
"Apache-2.0"
] | 1 | 2020-12-08T05:12:29.000Z | 2020-12-08T05:12:29.000Z | zclassifiershiftedae/prepare_data.py | VAShibaev/text_style_transfer | 42a4a653d7c47b5f04fe8c2b043f70a28b924e1f | [
"Apache-2.0"
] | 5 | 2019-10-21T22:46:05.000Z | 2020-10-20T02:28:45.000Z | # -*- coding: utf-8 -*-
# It's a code from
# Toward Controlled Generation of Text, ICML2017
# Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, Eric Xing
# https://github.com/asyml/texar/tree/master/examples/text_style_transfer
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may n... | 27.909091 | 74 | 0.694625 |
# Toward Controlled Generation of Text, ICML2017
# Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, Eric Xing
# https://github.com/asyml/texar/tree/master/examples/text_style_transfer
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | true | true |
1c47b6c5780ab8f0347dbfcc2cf7a16e0039e94d | 450 | py | Python | _app/posts/serializers.py | OmarThinks/DRF-Social-Project | e012c0d9e42e07948ef2fd7e391211ecf566a79a | [
"MIT"
] | null | null | null | _app/posts/serializers.py | OmarThinks/DRF-Social-Project | e012c0d9e42e07948ef2fd7e391211ecf566a79a | [
"MIT"
] | null | null | null | _app/posts/serializers.py | OmarThinks/DRF-Social-Project | e012c0d9e42e07948ef2fd7e391211ecf566a79a | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Post
from comments.serializers import CommentSerializer
#from django.conf import settings
# Serializers define the API representation.
class PostSerializer(serializers.HyperlinkedModelSerializer):
#comments = CommentSerializer(many=True, read_only=Tru... | 25 | 61 | 0.735556 | from rest_framework import serializers
from .models import Post
from comments.serializers import CommentSerializer
class PostSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Post
fields = ('id',"author" ,'content', "comments","url")
| true | true |
1c47b7a20cbcab7a8a56ae19a8d8c0cabb9a422d | 577 | py | Python | Class Work/composing-methods-more/burger_toppings.py | Pondorasti/SPD-2.3 | 42728c1f2dfc371fb6bdf1ba008c5d41266f2fa8 | [
"MIT"
] | null | null | null | Class Work/composing-methods-more/burger_toppings.py | Pondorasti/SPD-2.3 | 42728c1f2dfc371fb6bdf1ba008c5d41266f2fa8 | [
"MIT"
] | null | null | null | Class Work/composing-methods-more/burger_toppings.py | Pondorasti/SPD-2.3 | 42728c1f2dfc371fb6bdf1ba008c5d41266f2fa8 | [
"MIT"
] | null | null | null | # by Kami Bigdely
# Split temporary variable
patty = 70 # [gr]
pickle = 20 # [gr]
tomatoes = 25 # [gr]
lettuce = 15 # [gr]
buns = 95 # [gr]
ny_burger_weight = (2 * patty + 4 * pickle + 3 *
tomatoes + 2 * lettuce + 2 * buns)
print("NY Burger Weight", ny_burger_weight)
kimchi = 30 # [gr]
may... | 27.47619 | 78 | 0.59792 |
patty = 70 pickle = 20 tomatoes = 25 lettuce = 15 buns = 95
ny_burger_weight = (2 * patty + 4 * pickle + 3 *
tomatoes + 2 * lettuce + 2 * buns)
print("NY Burger Weight", ny_burger_weight)
kimchi = 30 mayo = 5 golden_fried_onion = 20 seoul_kimchi_burger_weight = (2 * patty + 4 * pickle + ... | true | true |
1c47b7b8a1f8b36aa064bd1292aa46d379b22d4a | 67 | py | Python | ApplicationServer/descriptors/__init__.py | paltmey/scias | 9006b85ad5a0084d7501413649e0679ba8adbe63 | [
"MIT"
] | null | null | null | ApplicationServer/descriptors/__init__.py | paltmey/scias | 9006b85ad5a0084d7501413649e0679ba8adbe63 | [
"MIT"
] | null | null | null | ApplicationServer/descriptors/__init__.py | paltmey/scias | 9006b85ad5a0084d7501413649e0679ba8adbe63 | [
"MIT"
] | null | null | null | from calculateDescriptors_cython import calculateDescriptors_cython | 67 | 67 | 0.955224 | from calculateDescriptors_cython import calculateDescriptors_cython | true | true |
1c47b8b7abc09b5031051f41169039d786791bfa | 10,082 | py | Python | configs/vrd/VRD_SgDet_heth_area_gnn_faster_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 24 | 2021-10-14T03:28:28.000Z | 2022-03-29T09:30:04.000Z | configs/vrd/VRD_SgDet_heth_area_gnn_faster_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-12-14T15:04:49.000Z | 2022-02-19T09:54:42.000Z | configs/vrd/VRD_SgDet_heth_area_gnn_faster_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-10-31T11:23:06.000Z | 2021-12-17T06:38:50.000Z | # dataset settings
dataset_type = 'VrdDataset'
data_root = 'data/vrd/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_rel=True),
dict(type='Resize'... | 36.930403 | 115 | 0.587681 | dataset_type = 'VrdDataset'
data_root = 'data/vrd/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_rel=True),
dict(type='Resize', img_scale=(1333, 8... | true | true |
1c47b9e4144242f50539d655abe8afb3386e443d | 1,209 | py | Python | examples/MERAOpt.py | vnechaev/QGOpt | 697f02d89df67a576cd6953ffdd2db62970727da | [
"Apache-2.0"
] | null | null | null | examples/MERAOpt.py | vnechaev/QGOpt | 697f02d89df67a576cd6953ffdd2db62970727da | [
"Apache-2.0"
] | null | null | null | examples/MERAOpt.py | vnechaev/QGOpt | 697f02d89df67a576cd6953ffdd2db62970727da | [
"Apache-2.0"
] | null | null | null | import QGOpt.manifolds as m
from tensorflow.python.keras.optimizer_v2 import optimizer_v2 as opt
import tensorflow as tf
def adj(A):
"""Correct adjoint
Args:
A: tf.tensor of shape (..., n, m)
Returns:
tf tensor of shape (..., m, n), adjoint matrix"""
return tf.math.conj(tf.linalg.matr... | 25.723404 | 79 | 0.623656 | import QGOpt.manifolds as m
from tensorflow.python.keras.optimizer_v2 import optimizer_v2 as opt
import tensorflow as tf
def adj(A):
return tf.math.conj(tf.linalg.matrix_transpose(A))
class MERAOpt(opt.OptimizerV2):
def __init__(self,
name="Fast"):
super(MERAOpt, self).__init__(n... | true | true |
1c47b9f5723d75dc27d382fcc620139929908569 | 5,099 | py | Python | sdk/AsposeEmailCloudSdk/models/object_exist.py | aspose-email-cloud/aspose-email-cloud-python | c5c13839cbbbfa5b6617bd1aedf3cf30cd664227 | [
"MIT"
] | 1 | 2020-02-26T13:19:06.000Z | 2020-02-26T13:19:06.000Z | sdk/AsposeEmailCloudSdk/models/object_exist.py | aspose-email-cloud/aspose-email-cloud-python | c5c13839cbbbfa5b6617bd1aedf3cf30cd664227 | [
"MIT"
] | null | null | null | sdk/AsposeEmailCloudSdk/models/object_exist.py | aspose-email-cloud/aspose-email-cloud-python | c5c13839cbbbfa5b6617bd1aedf3cf30cd664227 | [
"MIT"
] | null | null | null | # coding: utf-8
# ----------------------------------------------------------------------------
# <copyright company="Aspose" file="ObjectExist.py">
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining... | 32.069182 | 81 | 0.576388 |
import pprint
import re
import six
from typing import List, Set, Dict, Tuple, Optional
from datetime import datetime
class ObjectExist(object):
swagger_types = {
'exists': 'bool',
'is_folder': 'bool'
}
attribute_map = {
'exists': 'exists',
'is_folder': 'isFolder'
}
... | true | true |
1c47ba7cf688f8310a64c27916a4b31c58e71077 | 178 | py | Python | PythonDocs/src/002.py | Bean-jun/LearnGuide | 30a8567b222d18b15d3e9027a435b5bfe640a046 | [
"MIT"
] | 1 | 2022-02-23T13:42:01.000Z | 2022-02-23T13:42:01.000Z | PythonDocs/src/002.py | Bean-jun/LearnGuide | 30a8567b222d18b15d3e9027a435b5bfe640a046 | [
"MIT"
] | null | null | null | PythonDocs/src/002.py | Bean-jun/LearnGuide | 30a8567b222d18b15d3e9027a435b5bfe640a046 | [
"MIT"
] | null | null | null | # 单个变量赋值
name = "小明"
print(name)
# 多变量赋统一值
tom_age = jerry_age = 10
print(f"tom的年龄为{tom_age}, jerry的年龄为{jerry_age}")
# 多个变量赋不同值
name, age = "小明", 23
print(f"{name}的年龄是{age}岁")
| 14.833333 | 48 | 0.679775 | name = "小明"
print(name)
tom_age = jerry_age = 10
print(f"tom的年龄为{tom_age}, jerry的年龄为{jerry_age}")
name, age = "小明", 23
print(f"{name}的年龄是{age}岁")
| true | true |
1c47bc9b26db9cf25c8c537f793dfeaff97f5c14 | 4,813 | py | Python | homeassistant/components/ecobee/sensor.py | ottersen/home-assistant | 7a57c3a66af0e47cb6a1f9971dd2b14e6acae1bf | [
"Apache-2.0"
] | 2 | 2017-06-18T15:09:59.000Z | 2017-06-18T15:11:09.000Z | homeassistant/components/ecobee/sensor.py | ottersen/home-assistant | 7a57c3a66af0e47cb6a1f9971dd2b14e6acae1bf | [
"Apache-2.0"
] | null | null | null | homeassistant/components/ecobee/sensor.py | ottersen/home-assistant | 7a57c3a66af0e47cb6a1f9971dd2b14e6acae1bf | [
"Apache-2.0"
] | null | null | null | """Support for Ecobee sensors."""
from pyecobee.const import ECOBEE_STATE_CALIBRATING, ECOBEE_STATE_UNKNOWN
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
TEMP_FAHRENHEIT,
)
from homeassistant.helpers.entity import Entity
from .const import DOMAIN, ECOBEE_MODEL_TO_NAME,... | 35.651852 | 88 | 0.5909 | from pyecobee.const import ECOBEE_STATE_CALIBRATING, ECOBEE_STATE_UNKNOWN
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
TEMP_FAHRENHEIT,
)
from homeassistant.helpers.entity import Entity
from .const import DOMAIN, ECOBEE_MODEL_TO_NAME, MANUFACTURER, _LOGGER
SENSOR_TYP... | true | true |
1c47bca4679357156bbce5a4240e93b0d106e17f | 1,959 | py | Python | pycontracts/forward_solidity.py | rpip/contracts | a2d831e1ac4a728bc7342f8d2856bdeb79c37cc4 | [
"MIT"
] | null | null | null | pycontracts/forward_solidity.py | rpip/contracts | a2d831e1ac4a728bc7342f8d2856bdeb79c37cc4 | [
"MIT"
] | null | null | null | pycontracts/forward_solidity.py | rpip/contracts | a2d831e1ac4a728bc7342f8d2856bdeb79c37cc4 | [
"MIT"
] | 4 | 2019-02-01T13:46:47.000Z | 2020-01-17T00:46:44.000Z | from web3 import Web3
from pycontracts import contracts
from pycontracts.forward import Forward, CallReverted
class ForwardSolidity(Forward):
def __init__(self, contract, owner = None):
self.contract = contract
super().__init__(contract.address)
self._owner = owner
@staticmethod
de... | 32.114754 | 85 | 0.600306 | from web3 import Web3
from pycontracts import contracts
from pycontracts.forward import Forward, CallReverted
class ForwardSolidity(Forward):
def __init__(self, contract, owner = None):
self.contract = contract
super().__init__(contract.address)
self._owner = owner
@staticmethod
de... | true | true |
1c47bcf3b91293c8818a278695ef22bba118cc44 | 605 | py | Python | setup.py | lmijovic/pylhe | afd270044a5c37fec409daa1be45e67ac5fe9c82 | [
"Apache-2.0"
] | 1 | 2020-05-18T17:25:58.000Z | 2020-05-18T17:25:58.000Z | setup.py | 8me/pylhe | a165fba7f9cda1d3f28ae679e41571d52534dc9d | [
"Apache-2.0"
] | null | null | null | setup.py | 8me/pylhe | a165fba7f9cda1d3f28ae679e41571d52534dc9d | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
extras_require = {
"test": [
"pytest",
"pytest-cov>=2.5.1",
"scikit-hep-testdata>=0.3.1",
"pydocstyle",
"check-manifest",
"flake8",
],
}
extras_require["lint"] = sorted(set(["pyflakes", "black;python_version>='3.6'"]))
extras_require[... | 26.304348 | 81 | 0.618182 | from setuptools import setup
extras_require = {
"test": [
"pytest",
"pytest-cov>=2.5.1",
"scikit-hep-testdata>=0.3.1",
"pydocstyle",
"check-manifest",
"flake8",
],
}
extras_require["lint"] = sorted(set(["pyflakes", "black;python_version>='3.6'"]))
extras_require[... | true | true |
1c47bd99ea1abbad60f1ccb8e2ccf3f9e0e37943 | 7,863 | py | Python | tests/vhdl/test_decoder.py | jvanstraten/vhdmmio | f166b07074a9159311a01af88497df91c19e09d1 | [
"Apache-2.0"
] | 4 | 2019-07-01T14:41:38.000Z | 2021-11-28T12:54:49.000Z | tests/vhdl/test_decoder.py | jvanstraten/vhdmmio | f166b07074a9159311a01af88497df91c19e09d1 | [
"Apache-2.0"
] | 4 | 2019-08-23T15:05:24.000Z | 2020-12-16T10:02:20.000Z | tests/vhdl/test_decoder.py | jvanstraten/vhdmmio | f166b07074a9159311a01af88497df91c19e09d1 | [
"Apache-2.0"
] | 1 | 2021-07-16T13:41:21.000Z | 2021-07-16T13:41:21.000Z | """Unit tests for the VHDL address decoder generator."""
from unittest import TestCase
from vhdmmio.vhdl.address_decoder import AddressDecoder
from vhdmmio.core.address import MaskedAddress
from vhdmmio.template import TemplateEngine
class TestVhdlDecoder(TestCase):
"""Unit tests for the VHDL address decoder gene... | 32.626556 | 88 | 0.452499 |
from unittest import TestCase
from vhdmmio.vhdl.address_decoder import AddressDecoder
from vhdmmio.core.address import MaskedAddress
from vhdmmio.template import TemplateEngine
class TestVhdlDecoder(TestCase):
maxDiff = None
def _test_decoder(self, addresses, match=None,
optimize=False... | true | true |
1c47bd9fc2b2b2f8e378fb299617e772a61d05cc | 704 | py | Python | 0x0F-python-object_relational_mapping/4-cities_by_state.py | Rmolimock/holbertonschool-higher_level_programming | cf0421cbb6463b3960dc581badf7d4bbe1622b7d | [
"MIT"
] | 1 | 2019-05-21T09:34:41.000Z | 2019-05-21T09:34:41.000Z | 0x0F-python-object_relational_mapping/4-cities_by_state.py | Rmolimock/holbertonschool-higher_level_programming | cf0421cbb6463b3960dc581badf7d4bbe1622b7d | [
"MIT"
] | null | null | null | 0x0F-python-object_relational_mapping/4-cities_by_state.py | Rmolimock/holbertonschool-higher_level_programming | cf0421cbb6463b3960dc581badf7d4bbe1622b7d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
'''
Lists all states from a given database with given name
protect against sql injection
'''
import MySQLdb
from sys import argv
if __name__ == "__main__":
connection = MySQLdb.connect(host="localhost", port=3306, charset="utf8",
user=argv[1], passwd=argv[... | 30.608696 | 77 | 0.599432 | import MySQLdb
from sys import argv
if __name__ == "__main__":
connection = MySQLdb.connect(host="localhost", port=3306, charset="utf8",
user=argv[1], passwd=argv[2], db=argv[3])
cursor = connection.cursor()
cursor.execute("SELECT cities.id, cities.name, states.name"
... | true | true |
1c47be45651c7c68c942bf5b7c7f590e320b1cd0 | 49,438 | py | Python | homeassistant/components/google_assistant/trait.py | unverbraucht/core | 312af53935a1bffd58b3b35e82e31292a6ec22ad | [
"Apache-2.0"
] | 2 | 2019-11-20T20:56:59.000Z | 2021-01-03T08:52:18.000Z | homeassistant/components/google_assistant/trait.py | shownor/core | b50281a9173e7fb4a37b3f813ca92876088eaac3 | [
"Apache-2.0"
] | 5 | 2020-04-26T10:50:01.000Z | 2021-03-16T21:19:46.000Z | homeassistant/components/google_assistant/trait.py | winterscar/core | 5a55d508791aae65f16396691d014c73fb2095f0 | [
"Apache-2.0"
] | 1 | 2021-04-18T19:36:34.000Z | 2021-04-18T19:36:34.000Z | """Implement the Google Smart Home traits."""
import logging
from homeassistant.components import (
alarm_control_panel,
binary_sensor,
camera,
cover,
fan,
group,
input_boolean,
light,
lock,
media_player,
scene,
script,
sensor,
switch,
vacuum,
)
from homeassi... | 33.792208 | 88 | 0.594806 | import logging
from homeassistant.components import (
alarm_control_panel,
binary_sensor,
camera,
cover,
fan,
group,
input_boolean,
light,
lock,
media_player,
scene,
script,
sensor,
switch,
vacuum,
)
from homeassistant.components.climate import const as clima... | true | true |
1c47be6838a559b898608b686a690144038060ab | 811 | py | Python | mysite/mysite/urls.py | xinkaiwang/robotJump | 622e97451f450b755aecbd60e15b2cd47d875f47 | [
"MIT"
] | null | null | null | mysite/mysite/urls.py | xinkaiwang/robotJump | 622e97451f450b755aecbd60e15b2cd47d875f47 | [
"MIT"
] | null | null | null | mysite/mysite/urls.py | xinkaiwang/robotJump | 622e97451f450b755aecbd60e15b2cd47d875f47 | [
"MIT"
] | null | null | null | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | 35.26087 | 79 | 0.696671 | from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url('^', include('buckets.urls')),
]
| true | true |
1c47be6c708b01f8c5d2442695b7f5df61fef530 | 1,547 | py | Python | tests/python/gaia-ui-tests/gaiatest/tests/functional/clock/test_clock_run_stopwatch_laps.py | NickProgramm/gaia | 975a35c0f5010df341e96d6c5ec60217f5347412 | [
"Apache-2.0"
] | 3 | 2016-08-17T08:52:51.000Z | 2020-03-29T04:56:45.000Z | tests/python/gaia-ui-tests/gaiatest/tests/functional/clock/test_clock_run_stopwatch_laps.py | NickProgramm/gaia | 975a35c0f5010df341e96d6c5ec60217f5347412 | [
"Apache-2.0"
] | null | null | null | tests/python/gaia-ui-tests/gaiatest/tests/functional/clock/test_clock_run_stopwatch_laps.py | NickProgramm/gaia | 975a35c0f5010df341e96d6c5ec60217f5347412 | [
"Apache-2.0"
] | 1 | 2021-11-18T21:21:19.000Z | 2021-11-18T21:21:19.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from gaiatest import GaiaTestCase
from gaiatest.apps.clock.app import Clock
import time
class TestClockRunStopWatch(Ga... | 30.94 | 95 | 0.701357 |
from gaiatest import GaiaTestCase
from gaiatest.apps.clock.app import Clock
import time
class TestClockRunStopWatch(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.clock = Clock(self.marionette)
self.clock.launch()
def test_click_run_stopwatch_laps(self):
stop... | true | true |
1c47be9cac33d18c0c0a8c405deb236cf91a9e3f | 14,282 | py | Python | test/functional/p2p_unrequested_blocks.py | Quirky-Turt-Crypto/Quirky-Turt-Coin | 2fce9fe4f3be715a8ad3269ed9cefb4e5b6fad59 | [
"MIT"
] | null | null | null | test/functional/p2p_unrequested_blocks.py | Quirky-Turt-Crypto/Quirky-Turt-Coin | 2fce9fe4f3be715a8ad3269ed9cefb4e5b6fad59 | [
"MIT"
] | null | null | null | test/functional/p2p_unrequested_blocks.py | Quirky-Turt-Crypto/Quirky-Turt-Coin | 2fce9fe4f3be715a8ad3269ed9cefb4e5b6fad59 | [
"MIT"
] | 1 | 2021-05-16T16:09:23.000Z | 2021-05-16T16:09:23.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test processing of unrequested blocks.
Setup: two nodes, node0+node1, not connected to each other. Nod... | 44.080247 | 113 | 0.676096 |
from test_framework.mininode import *
from test_framework.test_framework import quirkyturtTestFramework
from test_framework.util import *
import time
from test_framework.blocktools import create_block, create_coinbase, create_transaction
class AcceptBlockTest(quirkyturtTestFramework):
def add_options(self, parser... | true | true |
1c47beb831ed519d0ec874e7fd8ab065c7a7379d | 6,290 | py | Python | patent_example/patent_example.py | RobKraft/dedupe-examples | bf02a805f8d1a0581b07c1eb81503c769b9541f1 | [
"MIT"
] | null | null | null | patent_example/patent_example.py | RobKraft/dedupe-examples | bf02a805f8d1a0581b07c1eb81503c769b9541f1 | [
"MIT"
] | null | null | null | patent_example/patent_example.py | RobKraft/dedupe-examples | bf02a805f8d1a0581b07c1eb81503c769b9541f1 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This code demonstrates how to use dedupe to disambiguate patent
authors and demonstrates the Set and LatLong data types.
"""
import os
import csv
import logging
import optparse
import dedupe
def readData(filename, set_delim='**'):
"""
Remap columns for the foll... | 31.767677 | 97 | 0.583466 |
import os
import csv
import logging
import optparse
import dedupe
def readData(filename, set_delim='**'):
data_d = {}
with open(filename) as f:
reader = csv.DictReader(f)
for idx, row in enumerate(reader):
row = dict((k, v.lower()) for k, v in row.items())
if row['La... | true | true |
1c47c26b2239aaaa497597e10ff585638018c10a | 446 | py | Python | oo/teste_carro.py | vladimirvinicius/pythonbirds | 2c0c6bfcda6fbeaffc36f6f04ccd94ab704e0b1a | [
"MIT"
] | 1 | 2020-10-04T03:29:20.000Z | 2020-10-04T03:29:20.000Z | oo/teste_carro.py | JosemarBrito/pythonbirds | eaa80f98bd4365b1146556b5f144dbab03fbf9bb | [
"MIT"
] | null | null | null | oo/teste_carro.py | JosemarBrito/pythonbirds | eaa80f98bd4365b1146556b5f144dbab03fbf9bb | [
"MIT"
] | null | null | null | from unittest import TestCase
from oo.carro import Motor
class CarroTestCase(TestCase):
def teste_velocidade_inicial(self):
motor = Motor()
self.assertEqual(0, motor.velocidade)
def teste_acelerar(self):
motor = Motor()
motor.acelerar()
self.assertEqual(1, motor.veloc... | 23.473684 | 45 | 0.650224 | from unittest import TestCase
from oo.carro import Motor
class CarroTestCase(TestCase):
def teste_velocidade_inicial(self):
motor = Motor()
self.assertEqual(0, motor.velocidade)
def teste_acelerar(self):
motor = Motor()
motor.acelerar()
self.assertEqual(1, motor.veloc... | true | true |
1c47c3ee33915e701135e1412bec7e390f756847 | 2,676 | py | Python | gamma_cloudinary/config.py | barakaVictor/django-gamma-cloudinary | 598af46844ca7b2de3cc832cb0d8dd3f9742e625 | [
"BSD-3-Clause"
] | 1 | 2022-03-13T13:44:19.000Z | 2022-03-13T13:44:19.000Z | gamma_cloudinary/config.py | barakaVictor/django-gamma-cloudinary | 598af46844ca7b2de3cc832cb0d8dd3f9742e625 | [
"BSD-3-Clause"
] | 4 | 2021-09-22T11:44:24.000Z | 2022-01-13T11:06:54.000Z | gamma_cloudinary/config.py | barakaVictor/django-gamma-cloudinary | 598af46844ca7b2de3cc832cb0d8dd3f9742e625 | [
"BSD-3-Clause"
] | null | null | null | import os
import cloudinary
from operator import itemgetter
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
#Execute setup code for cloudinary configuration
def setup_cloudinary():
if settings.configured:
try:
#check for the existence of CLOUDINARY_STORA... | 58.173913 | 142 | 0.664051 | import os
import cloudinary
from operator import itemgetter
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def setup_cloudinary():
if settings.configured:
try:
cloudinary_settings = getattr(settings, 'CLOUDINARY_STORAGE')
... | true | true |
1c47c4f4f4455be041aae5c83a2d2cfc01c700b7 | 1,554 | py | Python | pytest_curl_report/plugin.py | t2y/pytest-curl-report | 8690d8e6b78ad578af07ffad592556119304dac8 | [
"Apache-2.0"
] | null | null | null | pytest_curl_report/plugin.py | t2y/pytest-curl-report | 8690d8e6b78ad578af07ffad592556119304dac8 | [
"Apache-2.0"
] | null | null | null | pytest_curl_report/plugin.py | t2y/pytest-curl-report | 8690d8e6b78ad578af07ffad592556119304dac8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from .curl import Curl
from .utils import get_inspect_functions
PLUGIN_NAMESPACE = 'curl_report'
def pytest_addoption(parser):
group = parser.getgroup('curlreport', 'curl report')
group.addoption(
'--no-curl-report', dest='no_curl_report',
action='store... | 31.08 | 77 | 0.651866 | import pytest
from .curl import Curl
from .utils import get_inspect_functions
PLUGIN_NAMESPACE = 'curl_report'
def pytest_addoption(parser):
group = parser.getgroup('curlreport', 'curl report')
group.addoption(
'--no-curl-report', dest='no_curl_report',
action='store_true', default=False,
... | true | true |
1c47c521e31ebadae1e4b554a33840207018eda8 | 336 | py | Python | quilljs_example/example/models.py | muke5hy/django-quill | 16250b9c9418907123c8b40ddc66523af5d4e4d4 | [
"BSD-3-Clause"
] | 11 | 2019-02-20T08:58:43.000Z | 2021-01-03T16:41:07.000Z | quilljs_example/example/models.py | muke5hy/django-quill | 16250b9c9418907123c8b40ddc66523af5d4e4d4 | [
"BSD-3-Clause"
] | null | null | null | quilljs_example/example/models.py | muke5hy/django-quill | 16250b9c9418907123c8b40ddc66523af5d4e4d4 | [
"BSD-3-Clause"
] | 3 | 2019-10-08T18:04:01.000Z | 2020-11-02T12:15:03.000Z | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from quilljs.fields import RichTextField
@python_2_unicode_compatible
class ExampleModel(models.Model):
editor = RichTextField()
editor2 = RichTextField(config='basic')
def __str__(self):
return 'This is j... | 24 | 61 | 0.77381 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from quilljs.fields import RichTextField
@python_2_unicode_compatible
class ExampleModel(models.Model):
editor = RichTextField()
editor2 = RichTextField(config='basic')
def __str__(self):
return 'This is j... | true | true |
1c47c5651fa334d977285c340e3c9f7fa5d3f735 | 2,263 | py | Python | setup.py | RobertDeRose/python-robin-srv | dcb3b8a0dff71f2b63695fdab48b322998328fc2 | [
"BSD-2-Clause"
] | null | null | null | setup.py | RobertDeRose/python-robin-srv | dcb3b8a0dff71f2b63695fdab48b322998328fc2 | [
"BSD-2-Clause"
] | null | null | null | setup.py | RobertDeRose/python-robin-srv | dcb3b8a0dff71f2b63695fdab48b322998328fc2 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
fro... | 30.581081 | 98 | 0.606717 | from __future__ import absolute_import
from __future__ import print_function
import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
from setuptools import setup
def read(*names, **k... | true | true |
1c47c5ded622153fdda38f1bf3179dad8b91b2a3 | 2,653 | py | Python | tests/test_build.py | martinruenz/pytorch3d | 7f1e63aed1252ba8145d4a66ce2272331d60cdae | [
"BSD-3-Clause"
] | 3 | 2022-03-09T08:12:54.000Z | 2022-03-10T01:57:03.000Z | tests/test_build.py | martinruenz/pytorch3d | 7f1e63aed1252ba8145d4a66ce2272331d60cdae | [
"BSD-3-Clause"
] | null | null | null | tests/test_build.py | martinruenz/pytorch3d | 7f1e63aed1252ba8145d4a66ce2272331d60cdae | [
"BSD-3-Clause"
] | 1 | 2020-09-15T06:01:18.000Z | 2020-09-15T06:01:18.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import os
import unittest
from collections import Counter
from pathlib import Path
# This file groups together tests which look at the code without running it.
# When running the tests inside conda's build, the code is not available.
in_conda_bui... | 36.342466 | 84 | 0.560498 | import os
import unittest
from collections import Counter
from pathlib import Path
in_conda_build = os.environ.get("CONDA_BUILD_STATE", "") == "TEST"
class TestBuild(unittest.TestCase):
@unittest.skipIf(in_conda_build, "In conda build")
def test_name_clash(self):
# For setup.py, all translation unit... | true | true |
1c47c5f47a3efdc6396fd4dbe3e492f94d567901 | 8,567 | py | Python | pytorch_toolkit/face_recognition/dump_features.py | xzry6/openvino_training_extensions | b8b17bbcc352633b0f0d3a99d6179a9ec616e426 | [
"Apache-2.0"
] | 158 | 2019-03-01T15:47:39.000Z | 2022-02-10T15:10:48.000Z | dump_features.py | sacchinbhg/face_recognition.pytorch | 05cb9b30e8220445fcb27988926d88f330091c12 | [
"Apache-2.0"
] | 6 | 2020-03-08T22:58:13.000Z | 2022-03-12T00:15:14.000Z | dump_features.py | sacchinbhg/face_recognition.pytorch | 05cb9b30e8220445fcb27988926d88f330091c12 | [
"Apache-2.0"
] | 23 | 2019-03-02T09:18:19.000Z | 2021-11-06T22:01:56.000Z | """
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | 44.159794 | 155 | 0.65834 |
import sys
import argparse
import os
import os.path as osp
from tqdm import tqdm
import numpy as np
import glog as log
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torchvision import transforms as t
from scripts.matio import save_mat
from model.common import models_backbo... | true | true |
1c47c6a57ba1e3e281016c90e86575d8ae9b3a68 | 11,286 | py | Python | fpga/lib/eth/tb/test_axis_gmii_tx.py | totuwei/corundum | e983ad519fb4523d0ffca32f5e436195bcfc945c | [
"BSD-2-Clause-FreeBSD"
] | 1,121 | 2015-05-26T14:41:44.000Z | 2022-03-31T07:17:48.000Z | tb/test_axis_gmii_tx.py | yuzu762/verilog-ethernet | 108c02d721aada8a8f51e22328f6ca6c64b70d33 | [
"MIT"
] | 98 | 2016-02-12T21:15:45.000Z | 2022-03-31T03:13:00.000Z | tb/test_axis_gmii_tx.py | yuzu762/verilog-ethernet | 108c02d721aada8a8f51e22328f6ca6c64b70d33 | [
"MIT"
] | 368 | 2015-05-05T20:49:01.000Z | 2022-03-31T09:43:53.000Z | #!/usr/bin/env python
"""
Copyright (c) 2015-2018 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify,... | 32.153846 | 91 | 0.601985 |
from myhdl import *
import os
import axis_ep
import eth_ep
import gmii_ep
module = 'axis_gmii_tx'
testbench = 'test_%s' % module
srcs = []
srcs.append("../rtl/%s.v" % module)
srcs.append("../rtl/lfsr.v")
srcs.append("%s.v" % testbench)
src = ' '.join(srcs)
build_cmd = "iverilog -o %s.vvp %s" % (testbench, src)
... | true | true |
1c47c743603061855d979f37a27b7acaf2a74e4b | 7,496 | py | Python | python-modules/twisted/twisted/internet/ssl.py | stormtheh4ck3r/python-for-android | b9ea9161392f60566b81482b1e25cd77004d5c45 | [
"Apache-2.0"
] | 267 | 2015-03-22T15:23:48.000Z | 2022-03-05T21:57:34.000Z | python-modules/twisted/twisted/internet/ssl.py | rockyzhang/zhangyanhit-python-for-android-mips | 799dd5ca16f72135f2eab71e144a68842e2aaee0 | [
"Apache-2.0"
] | 133 | 2015-03-21T15:13:43.000Z | 2021-12-11T23:37:58.000Z | python-modules/twisted/twisted/internet/ssl.py | rockyzhang/zhangyanhit-python-for-android-mips | 799dd5ca16f72135f2eab71e144a68842e2aaee0 | [
"Apache-2.0"
] | 119 | 2015-04-28T16:07:10.000Z | 2022-03-18T03:49:48.000Z | # -*- test-case-name: twisted.test.test_ssl -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
SSL transport. Requires PyOpenSSL (http://pyopenssl.sf.net).
SSL connections require a ContextFactory so they can create SSL contexts.
End users should only use the ContextFactory cla... | 32.034188 | 102 | 0.689301 |
supported = False
from OpenSSL import SSL
from zope.interface import implements, implementsOnly, implementedBy
from twisted.internet import tcp, interfaces, base, address
class ContextFactory:
isClient = 0
def getContext(self):
raise NotImplementedError
class DefaultOpenSSLContextFactory(C... | true | true |
1c47c7b7ad1cb5f4dbaadc84f69896248dc1ef93 | 1,850 | py | Python | wikum-env3/lib/python3.7/site-packages/mwparserfromhell/nodes/text.py | xuericlin/wikum | f0171f1697efa91d6957f976f473c9201db85648 | [
"MIT"
] | 8 | 2021-04-29T16:49:45.000Z | 2021-08-09T18:56:35.000Z | wikum-env3/lib/python3.7/site-packages/mwparserfromhell/nodes/text.py | xuericlin/wikum | f0171f1697efa91d6957f976f473c9201db85648 | [
"MIT"
] | null | null | null | wikum-env3/lib/python3.7/site-packages/mwparserfromhell/nodes/text.py | xuericlin/wikum | f0171f1697efa91d6957f976f473c9201db85648 | [
"MIT"
] | 2 | 2020-08-03T13:02:06.000Z | 2020-11-04T03:15:44.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2019 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# 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 ... | 34.259259 | 79 | 0.718378 |
from __future__ import unicode_literals
from . import Node
from ..compat import str
__all__ = ["Text"]
class Text(Node):
def __init__(self, value):
super(Text, self).__init__()
self.value = value
def __unicode__(self):
return self.value
def __strip__(self, **kwargs):
r... | true | true |
1c47c8b56a82daffb467121923485a7868336d49 | 981 | py | Python | ratelimit/rule.py | abersheeran/asgi-ratelimit | 504de6dca1eb99762114a0886d502679a608799e | [
"Apache-2.0"
] | 136 | 2020-06-08T10:38:19.000Z | 2022-03-24T14:45:51.000Z | ratelimit/rule.py | abersheeran/asgi-ratelimit | 504de6dca1eb99762114a0886d502679a608799e | [
"Apache-2.0"
] | 38 | 2020-07-12T15:35:15.000Z | 2022-03-25T03:27:45.000Z | ratelimit/rule.py | abersheeran/asgi-ratelimit | 504de6dca1eb99762114a0886d502679a608799e | [
"Apache-2.0"
] | 15 | 2021-01-19T13:48:37.000Z | 2022-03-18T02:34:52.000Z | from dataclasses import dataclass
from typing import Dict, Optional, Tuple
@dataclass
class Rule:
group: str = "default"
second: Optional[int] = None
minute: Optional[int] = None
hour: Optional[int] = None
day: Optional[int] = None
month: Optional[int] = None
block_time: Optional[int] = ... | 24.525 | 87 | 0.566769 | from dataclasses import dataclass
from typing import Dict, Optional, Tuple
@dataclass
class Rule:
group: str = "default"
second: Optional[int] = None
minute: Optional[int] = None
hour: Optional[int] = None
day: Optional[int] = None
month: Optional[int] = None
block_time: Optional[int] = ... | true | true |
1c47c90a7ae040e58e2550f867ee1a2872a42dce | 32,446 | py | Python | cirq/sim/simulator.py | zchen088/Cirq | 8cf782554adbafed724987de3067de7ca565fa0c | [
"Apache-2.0"
] | 1 | 2019-12-18T17:42:14.000Z | 2019-12-18T17:42:14.000Z | cirq/sim/simulator.py | zchen088/Cirq | 8cf782554adbafed724987de3067de7ca565fa0c | [
"Apache-2.0"
] | null | null | null | cirq/sim/simulator.py | zchen088/Cirq | 8cf782554adbafed724987de3067de7ca565fa0c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 40.355721 | 98 | 0.654719 |
from typing import (
Any,
Dict,
Iterator,
List,
Sequence,
Tuple,
Union,
Optional,
TYPE_CHECKING,
Set,
cast,
Callable,
TypeVar,
Generic,
)
import abc
import collections
import numpy as np
from cirq import circuits, ops, protocols, study, value, work
from cirq.... | true | true |
1c47cab40dab1478d28390903e21858b737bfe1a | 1,859 | py | Python | tools/site_compare/commands/scrape.py | rwatson/chromium-capsicum | b03da8e897f897c6ad2cda03ceda217b760fd528 | [
"BSD-3-Clause"
] | 11 | 2015-03-20T04:08:08.000Z | 2021-11-15T15:51:36.000Z | tools/site_compare/commands/scrape.py | changbai1980/chromium | c4625eefca763df86471d798ee5a4a054b4716ae | [
"BSD-3-Clause"
] | null | null | null | tools/site_compare/commands/scrape.py | changbai1980/chromium | c4625eefca763df86471d798ee5a4a054b4716ae | [
"BSD-3-Clause"
] | 1 | 2020-04-13T05:45:10.000Z | 2020-04-13T05:45:10.000Z | #!/usr/bin/python2.4
# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Command for scraping images from a URL or list of URLs.
Prerequisites:
1. The command_line package from tools/site_compar... | 29.983871 | 85 | 0.720818 |
import command_line
from drivers import windowing
from utils import browser_iterate
def CreateCommand(cmdline):
cmd = cmdline.AddCommand(
["scrape"],
"Scrapes an image from a URL or series of URLs.",
None,
ExecuteScrape)
browser_iterate.SetupIterationCommandLine(cmd)
cmd.AddArgument(
["-l... | true | true |
1c47cad05b01e57c60e8dd11e39f42258a462d95 | 2,910 | py | Python | examples/orbslam_mono_kitti.py | frasermcghan/ORB_SLAM3-PythonBindings | a4fca4dbfbd70f31490e593f6c9e54c570827524 | [
"BSD-2-Clause",
"MIT"
] | 3 | 2021-11-12T06:11:19.000Z | 2022-03-17T04:24:25.000Z | examples/orbslam_mono_kitti.py | frasermcghan/ORB_SLAM3-PythonBindings | a4fca4dbfbd70f31490e593f6c9e54c570827524 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | examples/orbslam_mono_kitti.py | frasermcghan/ORB_SLAM3-PythonBindings | a4fca4dbfbd70f31490e593f6c9e54c570827524 | [
"BSD-2-Clause",
"MIT"
] | 1 | 2021-11-12T06:11:23.000Z | 2021-11-12T06:11:23.000Z | #!/usr/bin/env python3
import sys
import os.path
import orbslam3
import time
import cv2
def main(vocab_path, settings_path, sequence_path):
image_filenames, timestamps = load_images(sequence_path)
num_images = len(image_filenames)
slam = orbslam3.System(vocab_path, settings_path, orbslam3.Sensor.MONOCUL... | 27.980769 | 99 | 0.56323 | import sys
import os.path
import orbslam3
import time
import cv2
def main(vocab_path, settings_path, sequence_path):
image_filenames, timestamps = load_images(sequence_path)
num_images = len(image_filenames)
slam = orbslam3.System(vocab_path, settings_path, orbslam3.Sensor.MONOCULAR)
slam.set_use_vi... | true | true |
1c47cae1d8d4dc028de321451ca5cca46d806629 | 2,498 | py | Python | utils/nodes_key_pair_updator/NodesKeyPairUpdator.py | dawidsielski/medical-data-share | e462ffcfe0650b4fed2bb113c331a2a7438a8509 | [
"MIT"
] | null | null | null | utils/nodes_key_pair_updator/NodesKeyPairUpdator.py | dawidsielski/medical-data-share | e462ffcfe0650b4fed2bb113c331a2a7438a8509 | [
"MIT"
] | null | null | null | utils/nodes_key_pair_updator/NodesKeyPairUpdator.py | dawidsielski/medical-data-share | e462ffcfe0650b4fed2bb113c331a2a7438a8509 | [
"MIT"
] | null | null | null | import os
import requests
import logging
from logging.handlers import TimedRotatingFileHandler
from urllib.parse import urljoin
from configparser import ConfigParser
from data_share import DataShare
from data_share.KeyGeneration import KeyGeneration
from nodes_available.NodesChecker import NodesChecker
from utils.req... | 33.756757 | 118 | 0.700961 | import os
import requests
import logging
from logging.handlers import TimedRotatingFileHandler
from urllib.parse import urljoin
from configparser import ConfigParser
from data_share import DataShare
from data_share.KeyGeneration import KeyGeneration
from nodes_available.NodesChecker import NodesChecker
from utils.req... | true | true |
1c47cc9cf70b865d84b86c603de769862667adeb | 1,701 | py | Python | pioneer/temp/mujoco_test.py | xdralex/pioneer | 1fb9ea947d1b1cc2eb1f27bc4e8a7f206019b607 | [
"MIT"
] | 2 | 2020-07-29T07:49:06.000Z | 2021-04-13T20:57:45.000Z | pioneer/temp/mujoco_test.py | xdralex/pioneer | 1fb9ea947d1b1cc2eb1f27bc4e8a7f206019b607 | [
"MIT"
] | null | null | null | pioneer/temp/mujoco_test.py | xdralex/pioneer | 1fb9ea947d1b1cc2eb1f27bc4e8a7f206019b607 | [
"MIT"
] | 2 | 2020-07-25T11:45:54.000Z | 2021-01-11T07:12:07.000Z | import mujoco_py
import numpy as np
from gym import spaces
model = mujoco_py.load_model_from_path('pioneer/envs/assets/pioneer2.xml')
sim = mujoco_py.MjSim(model)
print(f'timestep: {model.opt.timestep}')
bounds = model.jnt_range.copy().astype(np.float32)
low, high = bounds.T
position_space = spaces.Box(low=low, high... | 21 | 78 | 0.661376 | import mujoco_py
import numpy as np
from gym import spaces
model = mujoco_py.load_model_from_path('pioneer/envs/assets/pioneer2.xml')
sim = mujoco_py.MjSim(model)
print(f'timestep: {model.opt.timestep}')
bounds = model.jnt_range.copy().astype(np.float32)
low, high = bounds.T
position_space = spaces.Box(low=low, high... | true | true |
1c47cd19af43c4d1becad7a2ad917dd2ed58f098 | 10,620 | py | Python | aliyun-python-sdk-ess/aliyunsdkess/request/v20140828/DescribeScalingGroupsRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | 1 | 2019-12-23T12:36:43.000Z | 2019-12-23T12:36:43.000Z | aliyun-python-sdk-ess/aliyunsdkess/request/v20140828/DescribeScalingGroupsRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-ess/aliyunsdkess/request/v20140828/DescribeScalingGroupsRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | 1 | 2021-02-23T11:27:54.000Z | 2021-02-23T11:27:54.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.4 | 80 | 0.789642 |
from aliyunsdkcore.request import RpcRequest
class DescribeScalingGroupsRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Ess', '2014-08-28', 'DescribeScalingGroups','ess')
def get_ResourceOwnerId(self):
return self.get_query_params().get('ResourceOwnerId')
def set_ResourceOwnerId(self... | true | true |
1c47d132a6791395267f3791dfb59ca1076cee0c | 360 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/models.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-06-02T08:01:35.000Z | 2021-06-02T08:01:35.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/models.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2019-06-04T18:12:16.000Z | 2019-06-04T18:12:16.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/models.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | null | null | null | # 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.
# ---------------------------------------------------------------------... | 45 | 76 | 0.444444 | from .v2018_06_01.models import *
| true | true |
1c47d191e4ced18e1fb9d2ca1bfe78d40d28d1ae | 2,572 | py | Python | tests/Modules/Indexer/test_DIALS_indexer.py | xia2/xia2 | 18554e9b4d442e7c23a0c4ce93f51b491f77d4b7 | [
"BSD-3-Clause"
] | 10 | 2015-10-30T06:36:55.000Z | 2021-12-10T20:06:22.000Z | tests/Modules/Indexer/test_DIALS_indexer.py | xia2/xia2 | 18554e9b4d442e7c23a0c4ce93f51b491f77d4b7 | [
"BSD-3-Clause"
] | 528 | 2015-11-24T08:20:12.000Z | 2022-03-21T21:47:29.000Z | tests/Modules/Indexer/test_DIALS_indexer.py | xia2/xia2 | 18554e9b4d442e7c23a0c4ce93f51b491f77d4b7 | [
"BSD-3-Clause"
] | 14 | 2016-03-15T22:07:03.000Z | 2020-12-14T07:13:35.000Z | from unittest import mock
import os
import pytest
import sys
from dxtbx.model import ExperimentList
from xia2.Handlers.Phil import PhilIndex
from xia2.Modules.Indexer.DialsIndexer import DialsIndexer
from xia2.Schema.XCrystal import XCrystal
from xia2.Schema.XWavelength import XWavelength
from xia2.Schema.XSweep impo... | 34.293333 | 83 | 0.728616 | from unittest import mock
import os
import pytest
import sys
from dxtbx.model import ExperimentList
from xia2.Handlers.Phil import PhilIndex
from xia2.Modules.Indexer.DialsIndexer import DialsIndexer
from xia2.Schema.XCrystal import XCrystal
from xia2.Schema.XWavelength import XWavelength
from xia2.Schema.XSweep impo... | true | true |
1c47d2457497fd988ef9644f3fcee1f778042ce5 | 1,002 | py | Python | mayan/apps/common/tests/runner.py | eshbeata/open-paperless | 6b9ed1f21908116ad2795b3785b2dbd66713d66e | [
"Apache-2.0"
] | 2,743 | 2017-12-18T07:12:30.000Z | 2022-03-27T17:21:25.000Z | mayan/apps/common/tests/runner.py | eshbeata/open-paperless | 6b9ed1f21908116ad2795b3785b2dbd66713d66e | [
"Apache-2.0"
] | 15 | 2017-12-18T14:58:07.000Z | 2021-03-01T20:05:05.000Z | mayan/apps/common/tests/runner.py | eshbeata/open-paperless | 6b9ed1f21908116ad2795b3785b2dbd66713d66e | [
"Apache-2.0"
] | 257 | 2017-12-18T03:12:58.000Z | 2022-03-25T08:59:10.000Z | from __future__ import unicode_literals
from django import apps
from django.test.runner import DiscoverRunner
class MayanTestRunner(DiscoverRunner):
@classmethod
def add_arguments(cls, parser):
DiscoverRunner.add_arguments(parser)
parser.add_argument(
'--mayan-apps', action='store... | 31.3125 | 75 | 0.610778 | from __future__ import unicode_literals
from django import apps
from django.test.runner import DiscoverRunner
class MayanTestRunner(DiscoverRunner):
@classmethod
def add_arguments(cls, parser):
DiscoverRunner.add_arguments(parser)
parser.add_argument(
'--mayan-apps', action='store... | true | true |
1c47d4df07c1c10285d70b8e964f1a6a01f4327e | 6,932 | py | Python | kf_d3m_primitives/natural_language_processing/sent2vec/sent2vec.py | Zac-hills/d3m-primitives | 1829fc98042dddfcbee3cfbbb8cb75dd452f1e8d | [
"Apache-2.0"
] | 1 | 2020-05-22T14:00:09.000Z | 2020-05-22T14:00:09.000Z | kf_d3m_primitives/natural_language_processing/sent2vec/sent2vec.py | Zac-hills/d3m-primitives | 1829fc98042dddfcbee3cfbbb8cb75dd452f1e8d | [
"Apache-2.0"
] | 18 | 2020-07-20T07:00:45.000Z | 2022-03-12T00:37:57.000Z | kf_d3m_primitives/natural_language_processing/sent2vec/sent2vec.py | Zac-hills/d3m-primitives | 1829fc98042dddfcbee3cfbbb8cb75dd452f1e8d | [
"Apache-2.0"
] | 6 | 2020-06-03T20:13:24.000Z | 2021-12-06T18:21:32.000Z | import os.path
from typing import Sequence, Optional, Dict
import numpy as np
import pandas as pd
from nk_sent2vec import Sent2Vec as _Sent2Vec
from d3m import container, utils
from d3m.primitive_interfaces.transformer import TransformerPrimitiveBase
from d3m.primitive_interfaces.base import CallResult
from d3m.contai... | 37.879781 | 130 | 0.604443 | import os.path
from typing import Sequence, Optional, Dict
import numpy as np
import pandas as pd
from nk_sent2vec import Sent2Vec as _Sent2Vec
from d3m import container, utils
from d3m.primitive_interfaces.transformer import TransformerPrimitiveBase
from d3m.primitive_interfaces.base import CallResult
from d3m.contai... | true | true |
1c47d526b70baa1b7149d593ed8aec9074118df1 | 1,016 | py | Python | setup.py | PrabhuLoganathan/pro.developers.PySelFame-6 | 3ee45e672f84965f0b8b3ccf7f8daf0c7d871261 | [
"BSD-3-Clause"
] | null | null | null | setup.py | PrabhuLoganathan/pro.developers.PySelFame-6 | 3ee45e672f84965f0b8b3ccf7f8daf0c7d871261 | [
"BSD-3-Clause"
] | null | null | null | setup.py | PrabhuLoganathan/pro.developers.PySelFame-6 | 3ee45e672f84965f0b8b3ccf7f8daf0c7d871261 | [
"BSD-3-Clause"
] | null | null | null |
from setuptools import setup
setup(
name='knitter',
version='1.0.2',
author='Henry Wang',
author_email='skymatrix@126.com',
maintainer='Henry Wang',
maintainer_email='skymatrix@126.com',
url='https://github.com/hw712/Knitter',
description='A Web Automation Test Framework Ba... | 22.577778 | 101 | 0.626969 |
from setuptools import setup
setup(
name='knitter',
version='1.0.2',
author='Henry Wang',
author_email='skymatrix@126.com',
maintainer='Henry Wang',
maintainer_email='skymatrix@126.com',
url='https://github.com/hw712/Knitter',
description='A Web Automation Test Framework Ba... | true | true |
1c47d61e29b517b660c0f0ee0e55960b22da7061 | 202 | py | Python | mywebsite/users/tests/test_models.py | NyntoFive/mywebsite | 07af16c564f8a7c77763187cc4cd8742c91c6534 | [
"MIT"
] | null | null | null | mywebsite/users/tests/test_models.py | NyntoFive/mywebsite | 07af16c564f8a7c77763187cc4cd8742c91c6534 | [
"MIT"
] | null | null | null | mywebsite/users/tests/test_models.py | NyntoFive/mywebsite | 07af16c564f8a7c77763187cc4cd8742c91c6534 | [
"MIT"
] | null | null | null | import pytest
from mywebsite.users.models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"
| 20.2 | 64 | 0.772277 | import pytest
from mywebsite.users.models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"
| true | true |
1c47d67efdc69d1364d3f7859468a66ce98d53af | 6,336 | py | Python | tests/integration/test_es.py | roguesupport/localstack | 087abb05fcb360297431ad8e5790c8014e0a80d7 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_es.py | roguesupport/localstack | 087abb05fcb360297431ad8e5790c8014e0a80d7 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_es.py | roguesupport/localstack | 087abb05fcb360297431ad8e5790c8014e0a80d7 | [
"Apache-2.0"
] | null | null | null | import logging
import threading
import botocore.exceptions
import pytest
from localstack import config
from localstack.constants import ELASTICSEARCH_DEFAULT_VERSION, OPENSEARCH_DEFAULT_VERSION
from localstack.services.install import install_elasticsearch, install_opensearch
from localstack.utils.common import safe_r... | 40.877419 | 103 | 0.72601 | import logging
import threading
import botocore.exceptions
import pytest
from localstack import config
from localstack.constants import ELASTICSEARCH_DEFAULT_VERSION, OPENSEARCH_DEFAULT_VERSION
from localstack.services.install import install_elasticsearch, install_opensearch
from localstack.utils.common import safe_r... | true | true |
1c47d7142612605ef5ca8a8c2d042e3d2166f135 | 5,609 | py | Python | aio_pika/robust_channel.py | askabelin/aio-pika | 38fd5897c556dd41624b8571b061f486e8e7508e | [
"Apache-2.0"
] | null | null | null | aio_pika/robust_channel.py | askabelin/aio-pika | 38fd5897c556dd41624b8571b061f486e8e7508e | [
"Apache-2.0"
] | null | null | null | aio_pika/robust_channel.py | askabelin/aio-pika | 38fd5897c556dd41624b8571b061f486e8e7508e | [
"Apache-2.0"
] | null | null | null | import asyncio
from typing import Callable, Any, Generator, Union
from logging import getLogger
from aio_pika.tools import create_future
from .compat import Awaitable
from .exchange import Exchange, ExchangeType
from .message import IncomingMessage
from .queue import Queue
from .common import BaseChannel, FutureStore... | 33.189349 | 112 | 0.63826 | import asyncio
from typing import Callable, Any, Generator, Union
from logging import getLogger
from aio_pika.tools import create_future
from .compat import Awaitable
from .exchange import Exchange, ExchangeType
from .message import IncomingMessage
from .queue import Queue
from .common import BaseChannel, FutureStore... | true | true |
1c47d7c374e86f2955d404bda2c09808e815f342 | 4,040 | py | Python | recipes/b2/portable/conanfile.py | Aypahyo/conan-center-index | c41d64960c66d3d81274d4189534f6fcb7bc4a36 | [
"MIT"
] | null | null | null | recipes/b2/portable/conanfile.py | Aypahyo/conan-center-index | c41d64960c66d3d81274d4189534f6fcb7bc4a36 | [
"MIT"
] | 1 | 2021-11-22T13:54:48.000Z | 2021-11-22T14:09:45.000Z | recipes/b2/portable/conanfile.py | Aypahyo/conan-center-index | c41d64960c66d3d81274d4189534f6fcb7bc4a36 | [
"MIT"
] | null | null | null | from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
import os
required_conan_version = ">=1.33.0"
class B2Conan(ConanFile):
name = "b2"
homepage = "https://www.bfgroup.xyz/b2/"
description = "B2 makes it easy to build C++ projects, everywhere."
topics = ("b2", "ins... | 41.22449 | 119 | 0.602723 | from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
import os
required_conan_version = ">=1.33.0"
class B2Conan(ConanFile):
name = "b2"
homepage = "https://www.bfgroup.xyz/b2/"
description = "B2 makes it easy to build C++ projects, everywhere."
topics = ("b2", "ins... | true | true |
1c47d83c488b457f490f24ffef2a609a22042fe3 | 2,173 | py | Python | tests/importer/onnx/basic/test_gemm.py | louareg/nncase | 0125654eb57b7ff753fe9c396c84b264c01f34d3 | [
"Apache-2.0"
] | null | null | null | tests/importer/onnx/basic/test_gemm.py | louareg/nncase | 0125654eb57b7ff753fe9c396c84b264c01f34d3 | [
"Apache-2.0"
] | null | null | null | tests/importer/onnx/basic/test_gemm.py | louareg/nncase | 0125654eb57b7ff753fe9c396c84b264c01f34d3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2021 Canaan Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 32.432836 | 100 | 0.655315 |
import pytest
import onnx
from onnx import helper
from onnx import AttributeProto, TensorProto, GraphProto
import numpy as np
from onnx_test_runner import OnnxTestRunner
def _make_module():
input_A = helper.make_tensor_value_info('A', TensorProto.FLOAT, [112, 224])
input_B = helper.make_tensor("B", TensorProt... | true | true |
1c47d8bd9f5b530094b55d25e5a8c3f6233d8908 | 140 | py | Python | src/pyggui/defaults/structures/__init__.py | 15minutOdmora/python-pyggui | 6675aeecfc7c47dac54a475dfb87d9e6b641041c | [
"MIT"
] | null | null | null | src/pyggui/defaults/structures/__init__.py | 15minutOdmora/python-pyggui | 6675aeecfc7c47dac54a475dfb87d9e6b641041c | [
"MIT"
] | null | null | null | src/pyggui/defaults/structures/__init__.py | 15minutOdmora/python-pyggui | 6675aeecfc7c47dac54a475dfb87d9e6b641041c | [
"MIT"
] | null | null | null | from pathlib import Path
# Define path constant at import time
PATH = Path(__file__).parent # Parent will fetch this files parent package
| 28 | 75 | 0.785714 | from pathlib import Path
PATH = Path(__file__).parent | true | true |
1c47dad798962eed2a8ddb76b9b3510f811c3e95 | 1,682 | py | Python | sensors/tfmini_ros/scripts/ros_tfmini_laser_scanner.py | mascaaj/rosdonkeycar | 2e98b837d9ad3a7dd73a3083f0866476501a73e7 | [
"MIT"
] | null | null | null | sensors/tfmini_ros/scripts/ros_tfmini_laser_scanner.py | mascaaj/rosdonkeycar | 2e98b837d9ad3a7dd73a3083f0866476501a73e7 | [
"MIT"
] | null | null | null | sensors/tfmini_ros/scripts/ros_tfmini_laser_scanner.py | mascaaj/rosdonkeycar | 2e98b837d9ad3a7dd73a3083f0866476501a73e7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from sensor_msgs.msg import LaserScan
from tfmini_servo_scanner import *
import math
SERVO_GPIO = 18
SRV_ANGLE_MIN = math.radians(-85)
SRV_ANGLE_MAX = math.radians(85)
SRV_DUTY_ANGLE_MIN = 2350
SRV_DUTY_ANGLE_MAX = 700
SRV_TIME_MIN_MAX = 0.7
LASER_ANGLE_SAM... | 30.035714 | 121 | 0.648038 |
import rospy
from sensor_msgs.msg import LaserScan
from tfmini_servo_scanner import *
import math
SERVO_GPIO = 18
SRV_ANGLE_MIN = math.radians(-85)
SRV_ANGLE_MAX = math.radians(85)
SRV_DUTY_ANGLE_MIN = 2350
SRV_DUTY_ANGLE_MAX = 700
SRV_TIME_MIN_MAX = 0.7
LASER_ANGLE_SAMPLES = 50
def tfmini... | true | true |
1c47dbc173fc346ee1f5f5043ff56d7fb45daca5 | 633 | py | Python | backend/manage.py | crowdbotics-apps/apptest-33096 | ab08576d017c0ba776394073ffaeeac46d72b8d2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/apptest-33096 | ab08576d017c0ba776394073ffaeeac46d72b8d2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/apptest-33096 | ab08576d017c0ba776394073ffaeeac46d72b8d2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'apptest_33096.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ... | 28.772727 | 77 | 0.685624 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'apptest_33096.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
1c47dbeb5a981b28bb4113e5889393e507765b42 | 8,223 | py | Python | discord/ext/flags/_command.py | CircuitsBots/Flag-Parsing | e5e997ef4a4642d15066df1ee9b62de05e2c2bc2 | [
"MIT"
] | 3 | 2021-03-16T20:54:37.000Z | 2021-11-11T11:01:20.000Z | discord/ext/flags/_command.py | CircuitsBots/Flag-Parsing | e5e997ef4a4642d15066df1ee9b62de05e2c2bc2 | [
"MIT"
] | null | null | null | discord/ext/flags/_command.py | CircuitsBots/Flag-Parsing | e5e997ef4a4642d15066df1ee9b62de05e2c2bc2 | [
"MIT"
] | 2 | 2021-09-17T04:24:57.000Z | 2022-02-05T17:11:25.000Z | import shlex
from collections import namedtuple
import argparse
import sys
import discord
from discord.ext import commands
from discord.ext.commands import converter
from . import _parser
__all__ = ["add_flag", "command", "group", "FlagCommand", "FlagGroup"]
argument = namedtuple("argument", "args kwargs")
def c... | 37.377273 | 109 | 0.538246 | import shlex
from collections import namedtuple
import argparse
import sys
import discord
from discord.ext import commands
from discord.ext.commands import converter
from . import _parser
__all__ = ["add_flag", "command", "group", "FlagCommand", "FlagGroup"]
argument = namedtuple("argument", "args kwargs")
def c... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.