hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c32edfabd39c304d7d0088ece80a414f1b16038 | 3,450 | py | Python | kubernetes/client/models/v1_pod_readiness_gate.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_pod_readiness_gate.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_pod_readiness_gate.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | 1 | 2019-01-10T11:13:52.000Z | 2019-01-10T11:13:52.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 26.953125 | 105 | 0.572754 |
from pprint import pformat
from six import iteritems
import re
class V1PodReadinessGate(object):
swagger_types = {
'condition_type': 'str'
}
attribute_map = {
'condition_type': 'conditionType'
}
def __init__(self, condition_type=None):
self._condition_type = None
... | true | true |
1c32ee85eb0940f440e81b3cb578789a02c6913d | 611 | py | Python | hydragnn/utils/__init__.py | allaffa/HydraGNN | b48f75cd3fe1b0d03bae9af3e6bdc2bb29f8b9c6 | [
"BSD-3-Clause"
] | null | null | null | hydragnn/utils/__init__.py | allaffa/HydraGNN | b48f75cd3fe1b0d03bae9af3e6bdc2bb29f8b9c6 | [
"BSD-3-Clause"
] | null | null | null | hydragnn/utils/__init__.py | allaffa/HydraGNN | b48f75cd3fe1b0d03bae9af3e6bdc2bb29f8b9c6 | [
"BSD-3-Clause"
] | null | null | null | from .print_utils import print_distributed, iterate_tqdm, setup_log
from .distributed import (
get_comm_size_and_rank,
get_device_list,
get_device,
get_device_name,
get_device_from_name,
is_model_distributed,
get_distributed_model,
setup_ddp,
)
from .model import (
save_model,
ge... | 22.62963 | 67 | 0.767594 | from .print_utils import print_distributed, iterate_tqdm, setup_log
from .distributed import (
get_comm_size_and_rank,
get_device_list,
get_device,
get_device_name,
get_device_from_name,
is_model_distributed,
get_distributed_model,
setup_ddp,
)
from .model import (
save_model,
ge... | true | true |
1c32eebf19a7d097e69ba31db590596e3b126e64 | 7,048 | py | Python | shop/models.py | jeffykle/kf-public | 2ea86908709f9903b626e7be192126053f39dfd2 | [
"MIT"
] | null | null | null | shop/models.py | jeffykle/kf-public | 2ea86908709f9903b626e7be192126053f39dfd2 | [
"MIT"
] | null | null | null | shop/models.py | jeffykle/kf-public | 2ea86908709f9903b626e7be192126053f39dfd2 | [
"MIT"
] | null | null | null | from decimal import Decimal
from address.models import AddressField
from django import forms
from django.contrib.auth.models import Group, Permission, User
from django.core.exceptions import ValidationError
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.db import models
from djang... | 33.245283 | 81 | 0.642594 | from decimal import Decimal
from address.models import AddressField
from django import forms
from django.contrib.auth.models import Group, Permission, User
from django.core.exceptions import ValidationError
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.db import models
from djang... | true | true |
1c32eefdfc4cf975266f521a2f569177431466c6 | 6,832 | py | Python | sentry_sdk/integrations/aiohttp.py | Ultimaker/sentry-python | 11b4bae19906cceb2091cafeee458a7f2002e498 | [
"BSD-2-Clause"
] | null | null | null | sentry_sdk/integrations/aiohttp.py | Ultimaker/sentry-python | 11b4bae19906cceb2091cafeee458a7f2002e498 | [
"BSD-2-Clause"
] | null | null | null | sentry_sdk/integrations/aiohttp.py | Ultimaker/sentry-python | 11b4bae19906cceb2091cafeee458a7f2002e498 | [
"BSD-2-Clause"
] | 1 | 2021-02-17T01:38:03.000Z | 2021-02-17T01:38:03.000Z | import sys
import weakref
from sentry_sdk._compat import reraise
from sentry_sdk.hub import Hub
from sentry_sdk.integrations import Integration
from sentry_sdk.integrations.logging import ignore_logger
from sentry_sdk.integrations._wsgi_common import (
_filter_headers,
request_body_within_bounds,
)
from sentry... | 33.655172 | 96 | 0.598507 | import sys
import weakref
from sentry_sdk._compat import reraise
from sentry_sdk.hub import Hub
from sentry_sdk.integrations import Integration
from sentry_sdk.integrations.logging import ignore_logger
from sentry_sdk.integrations._wsgi_common import (
_filter_headers,
request_body_within_bounds,
)
from sentry... | true | true |
1c32f1541522154feb791dd95a0f2cb90fe19515 | 20,451 | py | Python | bin/fence_create.py | themarcelor/fence | 9417655f84752477399e71b58b92c4c333b9704c | [
"Apache-2.0"
] | 31 | 2018-01-05T22:49:33.000Z | 2022-02-02T10:30:23.000Z | bin/fence_create.py | themarcelor/fence | 9417655f84752477399e71b58b92c4c333b9704c | [
"Apache-2.0"
] | 737 | 2017-12-11T17:42:11.000Z | 2022-03-29T22:42:52.000Z | bin/fence_create.py | themarcelor/fence | 9417655f84752477399e71b58b92c4c333b9704c | [
"Apache-2.0"
] | 46 | 2018-02-23T09:04:23.000Z | 2022-02-09T18:29:51.000Z | #!/usr/bin/env python
import argparse
import os
import sys
import logging
from cdislogging import get_logger
from fence.jwt import keys
from fence.config import config
from fence.scripting.fence_create import (
JWTCreator,
create_client_action,
create_or_update_google_bucket,
create_google_logging_bu... | 34.899317 | 108 | 0.643489 |
import argparse
import os
import sys
import logging
from cdislogging import get_logger
from fence.jwt import keys
from fence.config import config
from fence.scripting.fence_create import (
JWTCreator,
create_client_action,
create_or_update_google_bucket,
create_google_logging_bucket,
create_samp... | true | true |
1c32f183d08380b6732a9658109e07f7e8649d2e | 240 | py | Python | d-series/d462.py | TheLurkingCat/ZeroJudge | 6fc49c54a45e2b4b3a8d04b7a5a1fc81a2ff4eee | [
"MIT"
] | 1 | 2018-10-21T10:03:42.000Z | 2018-10-21T10:03:42.000Z | d-series/d462.py | TheLurkingCat/ZeroJudge | 6fc49c54a45e2b4b3a8d04b7a5a1fc81a2ff4eee | [
"MIT"
] | null | null | null | d-series/d462.py | TheLurkingCat/ZeroJudge | 6fc49c54a45e2b4b3a8d04b7a5a1fc81a2ff4eee | [
"MIT"
] | 2 | 2018-10-12T16:40:11.000Z | 2021-04-05T12:05:36.000Z | while True:
try:
a, n, i, k = [int(x) for x in input().split()]
except EOFError:
break
ans = str(pow(a, n))
print(ans[i-1:i+k-1])
print("From tomcat6 Fri Mar 15 09:53:56 2013\nTo: world\"\nSubject: \"Hello")
| 26.666667 | 77 | 0.558333 | while True:
try:
a, n, i, k = [int(x) for x in input().split()]
except EOFError:
break
ans = str(pow(a, n))
print(ans[i-1:i+k-1])
print("From tomcat6 Fri Mar 15 09:53:56 2013\nTo: world\"\nSubject: \"Hello")
| true | true |
1c32f4c1f8447fcc226b1a407730aab9d1d7083a | 531 | py | Python | setup.py | baek2sm/aithon | bfd9e3f19933026107fb40066bf8db0cfd845242 | [
"MIT"
] | 1 | 2021-12-04T01:18:59.000Z | 2021-12-04T01:18:59.000Z | setup.py | baek2sm/hackathon | bfd9e3f19933026107fb40066bf8db0cfd845242 | [
"MIT"
] | null | null | null | setup.py | baek2sm/hackathon | bfd9e3f19933026107fb40066bf8db0cfd845242 | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name='aithon',
version='0.0.1',
license='MIT',
author='SeungBaek Hong',
author_email='baek2sm@gmail.com',
description='Aithon is a library for use in AI hackathon.',
long_description=open('README.md').read(),
url='https://github.com/baek2sm/aithon',
... | 29.5 | 63 | 0.640301 | import setuptools
setuptools.setup(
name='aithon',
version='0.0.1',
license='MIT',
author='SeungBaek Hong',
author_email='baek2sm@gmail.com',
description='Aithon is a library for use in AI hackathon.',
long_description=open('README.md').read(),
url='https://github.com/baek2sm/aithon',
... | true | true |
1c32f4dce4709950ca69294b7a7f01bd0afc89b8 | 18,100 | py | Python | thread.py | yalhariri/twitter_collector | a411daf029ce86be0f2db0228de8ad360b9ef9ab | [
"MIT"
] | null | null | null | thread.py | yalhariri/twitter_collector | a411daf029ce86be0f2db0228de8ad360b9ef9ab | [
"MIT"
] | null | null | null | thread.py | yalhariri/twitter_collector | a411daf029ce86be0f2db0228de8ad360b9ef9ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 11 15:39:05 2020
@author: yalha
"""
import threading
import json
import time
import re
import nltk
import random
tokenizer = nltk.TweetTokenizer()
import requests
import os
from os import path, listdir, remove
from os.path import exists, join
impo... | 43.095238 | 463 | 0.609337 |
import threading
import json
import time
import re
import nltk
import random
tokenizer = nltk.TweetTokenizer()
import requests
import os
from os import path, listdir, remove
from os.path import exists, join
import logging
from logging.handlers import TimedRotatingFileHandler as _TimedRotatingFileHandler
import gzip... | true | true |
1c32f525161b731d8cc181719533cc70b454f4ed | 1,992 | py | Python | 010/infix_to_postfix.py | gauthamp10/100DaysOfCode | bcc1d02d3cf7ec78770a7645363a88e9930e2115 | [
"MIT"
] | null | null | null | 010/infix_to_postfix.py | gauthamp10/100DaysOfCode | bcc1d02d3cf7ec78770a7645363a88e9930e2115 | [
"MIT"
] | null | null | null | 010/infix_to_postfix.py | gauthamp10/100DaysOfCode | bcc1d02d3cf7ec78770a7645363a88e9930e2115 | [
"MIT"
] | null | null | null | """A funciton to convert a given infix expression
to postfix expression using Shunting Yard Algorithm"""
from stack import MyStack
def infix_to_postfix(infix):
"""Converts given infix expression to postfix expression
using Shunting Yard Algorithm"""
#stack to temporarily store operators and parant... | 38.307692 | 91 | 0.582831 |
from stack import MyStack
def infix_to_postfix(infix):
stack = MyStack(size= len(infix)+1)
postfix = []
is_operand = lambda char: char.isalpha() or char.isnumeric()
PRIORITY = {"+": 1, "-": 1, "*": 2, "/": 2, "%": 2, "^": 3}
precedence = lambda char... | true | true |
1c32f58b1962a49b338c7677b68e6852f2ba5390 | 3,346 | py | Python | middleware/legato/templates/common/bsp_utils.py | automaate/gfx3.8 | 55bf94302f00c8d513c84d910185cef2ca6b5be2 | [
"0BSD"
] | null | null | null | middleware/legato/templates/common/bsp_utils.py | automaate/gfx3.8 | 55bf94302f00c8d513c84d910185cef2ca6b5be2 | [
"0BSD"
] | null | null | null | middleware/legato/templates/common/bsp_utils.py | automaate/gfx3.8 | 55bf94302f00c8d513c84d910185cef2ca6b5be2 | [
"0BSD"
] | null | null | null | # coding: utf-8
##############################################################################
# Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries.
#
# Subject to your compliance with these terms, you may use Microchip software
# and any derivatives exclusively with Microchip products. It is your
... | 33.46 | 124 | 0.724447 | true | true | |
1c32f5fc921fedc717d9757873c7c0e3b35ca35d | 4,333 | py | Python | satsense/features/feature.py | fossabot/satsense | 6666dd01a6988a86319c71a8f8802bf4b096c550 | [
"Apache-2.0"
] | 22 | 2018-03-14T10:29:38.000Z | 2022-03-29T10:54:51.000Z | satsense/features/feature.py | fdbesanto2/satsense | b0fa650193995a30328f26a36ebab2437c0e37ef | [
"Apache-2.0"
] | 49 | 2018-05-25T13:28:07.000Z | 2021-07-31T09:48:02.000Z | satsense/features/feature.py | fdbesanto2/satsense | b0fa650193995a30328f26a36ebab2437c0e37ef | [
"Apache-2.0"
] | 11 | 2018-04-24T08:55:28.000Z | 2021-02-17T22:32:05.000Z | from abc import ABC, abstractmethod
class Feature(ABC):
"""
Feature superclass.
Parameters
----------
window_shapes : list[tuple]
List of tuples of window shapes to calculate the feature on
**kwargs : dict
Keyword arguments for the feature
Attributes
-... | 25.19186 | 77 | 0.560582 | from abc import ABC, abstractmethod
class Feature(ABC):
base_image = None
size = None
def __init__(self, window_shapes, **kwargs):
self._indices = {}
self._length = 0
self._windows = tuple(sorted(window_shapes, reverse=True))
self.kwargs = kwargs
self.name = self... | true | true |
1c32f72e07a1f6cfb11be0c78d0d706399c65872 | 35,697 | py | Python | python/ray/tune/test/trial_scheduler_test.py | yfletberliac/ray | 2fd48afa082af012420c3e1a3240e3904cf72c04 | [
"Apache-2.0"
] | 29 | 2019-05-18T12:18:34.000Z | 2022-03-30T01:46:48.000Z | ray/tune/test/trial_scheduler_test.py | kivo360/tesp | a77d9c228a6891b304e789ba2758a4cbfdb75ec0 | [
"MIT"
] | 8 | 2019-08-15T05:42:10.000Z | 2021-05-21T09:41:15.000Z | ray/tune/test/trial_scheduler_test.py | kivo360/tesp | a77d9c228a6891b304e789ba2758a4cbfdb75ec0 | [
"MIT"
] | 8 | 2019-07-15T22:36:20.000Z | 2020-08-09T07:03:26.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
import unittest
import numpy as np
import ray
from ray.tune.schedulers import (HyperBandScheduler, AsyncHyperBandScheduler,
PopulationBasedTraining, MedianStoppin... | 39.184413 | 79 | 0.60837 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
import unittest
import numpy as np
import ray
from ray.tune.schedulers import (HyperBandScheduler, AsyncHyperBandScheduler,
PopulationBasedTraining, MedianStoppin... | true | true |
1c32f8b1da1b45f5c2b37ac0c668b07eb2a168b1 | 3,197 | py | Python | xmodaler/utils/colormap.py | cclauss/xmodaler | 1368fba6c550e97008628edbf01b59a0a6c8fde5 | [
"Apache-2.0"
] | 830 | 2021-06-26T07:16:33.000Z | 2022-03-25T10:31:32.000Z | xmodaler/utils/colormap.py | kevinjunwei/xmodaler | 3e128a816876988c5fb07d842fde4a140e699dde | [
"Apache-2.0"
] | 28 | 2021-08-19T12:39:02.000Z | 2022-03-14T13:04:19.000Z | xmodaler/utils/colormap.py | kevinjunwei/xmodaler | 3e128a816876988c5fb07d842fde4a140e699dde | [
"Apache-2.0"
] | 85 | 2021-08-15T06:58:29.000Z | 2022-02-19T07:30:56.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
"""
An awesome colormap for really neat visualizations.
Copied from Detectron, and removed gray colors.
"""
import numpy as np
__all__ = ["colormap", "random_color"]
# fmt: off
# RGB:
_COLORS = np.array(
[
0.000, 0.447, 0.741,
0.850, 0.325, 0.09... | 25.782258 | 75 | 0.474195 |
import numpy as np
__all__ = ["colormap", "random_color"]
_COLORS = np.array(
[
0.000, 0.447, 0.741,
0.850, 0.325, 0.098,
0.929, 0.694, 0.125,
0.494, 0.184, 0.556,
0.466, 0.674, 0.188,
0.301, 0.745, 0.933,
0.635, 0.078, 0.184,
0.300, 0.300, 0.30... | true | true |
1c32f8fbb92ee5978bbd98488f6b44b6b6a6c68b | 1,619 | py | Python | pages/migrations/0001_initial.py | mikehagquist/fitapps3 | 43b46cd475e635fd9ab9542960a65197941a0172 | [
"MIT"
] | null | null | null | pages/migrations/0001_initial.py | mikehagquist/fitapps3 | 43b46cd475e635fd9ab9542960a65197941a0172 | [
"MIT"
] | 3 | 2020-02-11T23:58:50.000Z | 2021-06-10T21:32:19.000Z | pages/migrations/0001_initial.py | mikehagquist/fitapps3 | 43b46cd475e635fd9ab9542960a65197941a0172 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2019-03-21 11:42
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... | 35.977778 | 120 | 0.594194 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... | true | true |
1c32fad27afe9a2b54ac92330f5bf52a9aa3472c | 103 | py | Python | src/config_mnist_train.py | RaulRC/genetic-neural-optimizer | fa169cdc9b43c58470c3e7a7214185d56e61579a | [
"MIT"
] | 1 | 2021-04-30T09:07:15.000Z | 2021-04-30T09:07:15.000Z | src/config_mnist_train.py | RaulRC/genetic-neural-optimizer | fa169cdc9b43c58470c3e7a7214185d56e61579a | [
"MIT"
] | 5 | 2020-01-28T23:00:10.000Z | 2022-02-10T00:16:05.000Z | src/config_mnist_train.py | RaulRC/genetic-neural-optimizer | fa169cdc9b43c58470c3e7a7214185d56e61579a | [
"MIT"
] | null | null | null | iterations = 5
generations_list = [500]
populations_list = [6]
elitism_list = [0.5]
mutables_list = [1] | 20.6 | 24 | 0.728155 | iterations = 5
generations_list = [500]
populations_list = [6]
elitism_list = [0.5]
mutables_list = [1] | true | true |
1c32fbac352e7981530d8bb51524d93d32c8814e | 41,572 | py | Python | pydl_image_encoders/library/tf/imagenet_utils.py | chen0040/pydl-image-encoders | 73c0fb02842fabf824fe78735a180dcc0570624d | [
"MIT"
] | 1 | 2018-03-18T21:46:33.000Z | 2018-03-18T21:46:33.000Z | pydl_image_encoders/library/tf/imagenet_utils.py | chen0040/pydl-image-encoders | 73c0fb02842fabf824fe78735a180dcc0570624d | [
"MIT"
] | null | null | null | pydl_image_encoders/library/tf/imagenet_utils.py | chen0040/pydl-image-encoders | 73c0fb02842fabf824fe78735a180dcc0570624d | [
"MIT"
] | 1 | 2018-03-18T21:46:34.000Z | 2018-03-18T21:46:34.000Z | imagenet_labels = {0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, c... | 41.53047 | 141 | 0.500674 | imagenet_labels = {0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, c... | true | true |
1c32fc89f06887339f4641eb18f01625dfc85e16 | 7,586 | py | Python | Extra/resample.py | niefermar/APPIAN-PET-APPIAN | 895fa3aaad7f444d6f4e6f7c698ddace9415664c | [
"MIT"
] | null | null | null | Extra/resample.py | niefermar/APPIAN-PET-APPIAN | 895fa3aaad7f444d6f4e6f7c698ddace9415664c | [
"MIT"
] | null | null | null | Extra/resample.py | niefermar/APPIAN-PET-APPIAN | 895fa3aaad7f444d6f4e6f7c698ddace9415664c | [
"MIT"
] | null | null | null | import os, ntpath
import numpy as np
import re
from nipype.interfaces.base import CommandLine, CommandLineInputSpec, BaseInterface
from nipype.interfaces.base import (TraitedSpec, File, traits, InputMultiPath,isdefined)
class ResampleOutput(TraitedSpec):
# out_file = File(exists=True, desc="resampled image")
ou... | 44.623529 | 161 | 0.679278 | import os, ntpath
import numpy as np
import re
from nipype.interfaces.base import CommandLine, CommandLineInputSpec, BaseInterface
from nipype.interfaces.base import (TraitedSpec, File, traits, InputMultiPath,isdefined)
class ResampleOutput(TraitedSpec):
out_file = File(desc="resampled image")
class ResampleInpu... | false | true |
1c32fdb227564e56f103f322d9d23eee416880fb | 14,455 | py | Python | src/sdk/pynni/nni/compression/torch/utils/shape_dependency.py | CuriousCat-7/nni | 66057ba74c5252e38a576712b59a8bf867e2d514 | [
"MIT"
] | 3 | 2021-04-19T08:26:46.000Z | 2022-03-22T20:17:17.000Z | src/sdk/pynni/nni/compression/torch/utils/shape_dependency.py | CuriousCat-7/nni | 66057ba74c5252e38a576712b59a8bf867e2d514 | [
"MIT"
] | 21 | 2020-11-13T19:01:01.000Z | 2022-02-27T09:12:51.000Z | src/sdk/pynni/nni/compression/torch/utils/shape_dependency.py | CuriousCat-7/nni | 66057ba74c5252e38a576712b59a8bf867e2d514 | [
"MIT"
] | 3 | 2020-10-23T02:53:47.000Z | 2020-11-15T22:05:09.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import csv
import logging
__all__ = ['ChannelDependency', 'GroupDependency', 'CatPaddingDependency']
CONV_TYPE = 'aten::_convolution'
ADD_TYPES = ['aten::add', 'aten::add_']
CAT_TYPE = 'aten::cat'
logger = logging.getLogger('Shape_Dependency')
... | 37.643229 | 97 | 0.576825 |
import csv
import logging
__all__ = ['ChannelDependency', 'GroupDependency', 'CatPaddingDependency']
CONV_TYPE = 'aten::_convolution'
ADD_TYPES = ['aten::add', 'aten::add_']
CAT_TYPE = 'aten::cat'
logger = logging.getLogger('Shape_Dependency')
class Dependency:
def __init__(self, model=None, dummy_input=None... | true | true |
1c330062e0a400ccec94be55403fe68eeb51645a | 30,197 | py | Python | keras/layers/preprocessing/index_lookup.py | kanesp/keras | 7f8c62b90274f9c5a261984c098312ff8fab3d66 | [
"Apache-2.0"
] | 1 | 2021-03-16T09:37:55.000Z | 2021-03-16T09:37:55.000Z | keras/layers/preprocessing/index_lookup.py | kanesp/keras | 7f8c62b90274f9c5a261984c098312ff8fab3d66 | [
"Apache-2.0"
] | null | null | null | keras/layers/preprocessing/index_lookup.py | kanesp/keras | 7f8c62b90274f9c5a261984c098312ff8fab3d66 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 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... | 42.11576 | 80 | 0.675498 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v2 as tf
import collections
import json
import operator
import numpy as np
from keras import backend as K
from keras.engine import base_preprocessing_layer
from keras.l... | true | true |
1c33009f274ee36e4bf41a2d5ea5c86909d87893 | 595 | py | Python | test_project/manage.py | bigsassy/django-facetools | aeedaea81ab0007ee8e96b2f81f1404dc8bddb3c | [
"MIT"
] | 2 | 2018-01-24T20:41:27.000Z | 2019-06-27T13:24:18.000Z | test_project/manage.py | bigsassy/django-facetools | aeedaea81ab0007ee8e96b2f81f1404dc8bddb3c | [
"MIT"
] | null | null | null | test_project/manage.py | bigsassy/django-facetools | aeedaea81ab0007ee8e96b2f81f1404dc8bddb3c | [
"MIT"
] | null | null | null | import os
import sys
from django.core.management import execute_manager
import imp
pwd = os.path.dirname(__file__)
sys.path.append(os.path.abspath(os.path.join(pwd, '../')))
try:
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can'... | 29.75 | 216 | 0.739496 | import os
import sys
from django.core.management import execute_manager
import imp
pwd = os.path.dirname(__file__)
sys.path.append(os.path.abspath(os.path.join(pwd, '../')))
try:
imp.find_module('settings')
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the d... | true | true |
1c33010719a799e22a2d75fd1a0cabf3989197a4 | 646 | py | Python | recipes/Python/347243_Automate_CATIV5/recipe-347243.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/347243_Automate_CATIV5/recipe-347243.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/347243_Automate_CATIV5/recipe-347243.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | import win32com.client
catapp = win32com.client.Dispatch("CATIA.Application")
doc=catapp.ActiveDocument.Product
product_count = doc.Products.Count
print "This example lists all Parts and Subproducts of the first level from a CATProduct."
for products in range(product_count):
products = products + 1
print doc.P... | 40.375 | 95 | 0.741486 | import win32com.client
catapp = win32com.client.Dispatch("CATIA.Application")
doc=catapp.ActiveDocument.Product
product_count = doc.Products.Count
print "This example lists all Parts and Subproducts of the first level from a CATProduct."
for products in range(product_count):
products = products + 1
print doc.P... | false | true |
1c3301b06f2c47aee6adc2cd1044485633064ee5 | 16,709 | py | Python | nmt/joint/csimplejoint.py | Roxot/AEVNMT | 5ebc6ec76b2c891ab76a5584a15e735145fdc43b | [
"Apache-2.0"
] | 15 | 2018-07-30T13:19:58.000Z | 2019-10-20T13:58:10.000Z | nmt/joint/csimplejoint.py | Roxot/AEVNMT | 5ebc6ec76b2c891ab76a5584a15e735145fdc43b | [
"Apache-2.0"
] | null | null | null | nmt/joint/csimplejoint.py | Roxot/AEVNMT | 5ebc6ec76b2c891ab76a5584a15e735145fdc43b | [
"Apache-2.0"
] | null | null | null | """
:Authors: - Bryan Eikema
"""
import tensorflow as tf
import nmt.utils.misc_utils as utils
from . import DSimpleJointModel
from nmt import model_helper
from .utils import language_model
from nmt.utils.gaussianhelper import GaussianHelper
from nmt.utils.amt_utils import enrich_embeddings_with_positions, self_atten... | 41.155172 | 119 | 0.707283 |
import tensorflow as tf
import nmt.utils.misc_utils as utils
from . import DSimpleJointModel
from nmt import model_helper
from .utils import language_model
from nmt.utils.gaussianhelper import GaussianHelper
from nmt.utils.amt_utils import enrich_embeddings_with_positions, self_attention_layer, diagonal_attention_co... | true | true |
1c33045044c41d07abe899c546597c89767ac0a5 | 3,457 | py | Python | services/models.py | Jordzman/explorer | d0b796014320761cd751429a9dc6ad48fe90ed96 | [
"Apache-2.0"
] | 2 | 2016-08-07T02:59:23.000Z | 2016-08-21T23:48:03.000Z | services/models.py | Trevorulliac/explorer | d2f836afd0b827041b1c75a8dd056fdb2beb2e1d | [
"Apache-2.0"
] | 29 | 2020-05-01T08:05:16.000Z | 2021-06-25T15:36:13.000Z | services/models.py | Trevorulliac/explorer | d2f836afd0b827041b1c75a8dd056fdb2beb2e1d | [
"Apache-2.0"
] | 1 | 2016-02-09T21:47:34.000Z | 2016-02-09T21:47:34.000Z | from django.db import models
from blockexplorer.raven import client
from jsonfield import JSONField
from utils import get_client_ip, uri_to_url, is_good_status_code, get_user_agent
import json
import requests
class APICall(models.Model):
"""
To keep track of all our external API calls and aid in debugging... | 37.576087 | 111 | 0.689037 | from django.db import models
from blockexplorer.raven import client
from jsonfield import JSONField
from utils import get_client_ip, uri_to_url, is_good_status_code, get_user_agent
import json
import requests
class APICall(models.Model):
API_NAME_CHOICES = ()
created_at = models.DateTimeField(auto_... | true | true |
1c33046ed0d758165c4c2cf5afaa8e2465772ca8 | 341 | py | Python | Tests/__init__.py | Jakar510/PythonExtensions | f29600f73454d21345f6da893a1df1b71ddacd0b | [
"MIT"
] | null | null | null | Tests/__init__.py | Jakar510/PythonExtensions | f29600f73454d21345f6da893a1df1b71ddacd0b | [
"MIT"
] | null | null | null | Tests/__init__.py | Jakar510/PythonExtensions | f29600f73454d21345f6da893a1df1b71ddacd0b | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# Created by Tyler Stegmaier
# Copyright (c) 2021.
#
# ------------------------------------------------------------------------------
from .SwitchCase import *
from .test_tk import *
from .tests import *
def Run():
import unittest... | 22.733333 | 80 | 0.354839 |
from .SwitchCase import *
from .test_tk import *
from .tests import *
def Run():
import unittest
unittest.main()
| true | true |
1c33060502174fd1ff63d68472a286c693fcc071 | 249 | py | Python | kader/kader/doctype/custody/custody.py | Muad96/kader | 287d37d110ec2058256d4936d3ef69345781e1a5 | [
"MIT"
] | null | null | null | kader/kader/doctype/custody/custody.py | Muad96/kader | 287d37d110ec2058256d4936d3ef69345781e1a5 | [
"MIT"
] | null | null | null | kader/kader/doctype/custody/custody.py | Muad96/kader | 287d37d110ec2058256d4936d3ef69345781e1a5 | [
"MIT"
] | 1 | 2021-08-01T13:47:36.000Z | 2021-08-01T13:47:36.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, KABCO and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Custody(Document):
pass
| 22.636364 | 49 | 0.7751 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Custody(Document):
pass
| true | true |
1c33065e10b05c1e01c2284f426936a6e62f4a23 | 1,249 | py | Python | python/paddle/fluid/tests/unittests/test_is_integer.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 8 | 2016-08-15T07:02:27.000Z | 2016-08-24T09:34:00.000Z | python/paddle/fluid/tests/unittests/test_is_integer.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 1 | 2021-11-01T06:28:16.000Z | 2021-11-01T06:28:16.000Z | python/paddle/fluid/tests/unittests/test_is_integer.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 5 | 2021-12-10T11:20:06.000Z | 2022-02-18T05:18:12.000Z | # Copyright (c) 2021 PaddlePaddle 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 ap... | 31.225 | 74 | 0.703763 |
import paddle
import numpy as np
import unittest
class TestIsInteger(unittest.TestCase):
def test_for_integer(self):
x = paddle.arange(10)
self.assertTrue(paddle.is_integer(x))
def test_for_floating_point(self):
x = paddle.randn([2, 3])
self.assertFalse(paddle.is... | true | true |
1c33077976c61c4be83e2036907ca191f93bc51d | 11,718 | py | Python | os_brick/tests/encryptors/test_luks.py | ebalduf/os-brick-backports | 6a180265560d5e0bab80e47ac25c15906d1165fb | [
"Apache-2.0"
] | null | null | null | os_brick/tests/encryptors/test_luks.py | ebalduf/os-brick-backports | 6a180265560d5e0bab80e47ac25c15906d1165fb | [
"Apache-2.0"
] | null | null | null | os_brick/tests/encryptors/test_luks.py | ebalduf/os-brick-backports | 6a180265560d5e0bab80e47ac25c15906d1165fb | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | 45.595331 | 78 | 0.602577 |
import binascii
import mock
import uuid
from castellan.common.objects import symmetric_key as key
from os_brick.encryptors import luks
from os_brick.tests.encryptors import test_cryptsetup
from oslo_concurrency import processutils as putils
class LuksEncryptorTestCase(test_cryptsetup.CryptsetupEncryp... | true | true |
1c3307cede4860fba7a140ac76e94cbe6915d805 | 390 | py | Python | USMAN_MURTALA_ABDULLAHI/python assignment.py | Abdulusy/cil-internship-cohort-02 | 32571631567a8fbae24a83acad668ca0bf476f2c | [
"MIT"
] | null | null | null | USMAN_MURTALA_ABDULLAHI/python assignment.py | Abdulusy/cil-internship-cohort-02 | 32571631567a8fbae24a83acad668ca0bf476f2c | [
"MIT"
] | null | null | null | USMAN_MURTALA_ABDULLAHI/python assignment.py | Abdulusy/cil-internship-cohort-02 | 32571631567a8fbae24a83acad668ca0bf476f2c | [
"MIT"
] | null | null | null | import cv2
from cv2 import INTER_AREA
img = cv2.read("mm.jpg")
scale_percent=0.50
width=int(img.shape[1]*scale_percent)
height=int(img.shape[0]*scale_percent)
dimension=(width,height)
resized=cv2.resize(img,dimension,interpolation=INTER_AREA)
print(resized.shape)
cv2.imshow('outout', resized)
cv2.imwrite('r... | 24.375 | 59 | 0.75641 | import cv2
from cv2 import INTER_AREA
img = cv2.read("mm.jpg")
scale_percent=0.50
width=int(img.shape[1]*scale_percent)
height=int(img.shape[0]*scale_percent)
dimension=(width,height)
resized=cv2.resize(img,dimension,interpolation=INTER_AREA)
print(resized.shape)
cv2.imshow('outout', resized)
cv2.imwrite('r... | true | true |
1c33086347508a4ad3a1ba5a83f4b8ecd0df0c04 | 268 | py | Python | tests/artificial/transf_Integration/trend_LinearTrend/cycle_5/ar_/test_artificial_32_Integration_LinearTrend_5__100.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_Integration/trend_LinearTrend/cycle_5/ar_/test_artificial_32_Integration_LinearTrend_5__100.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_Integration/trend_LinearTrend/cycle_5/ar_/test_artificial_32_Integration_LinearTrend_5__100.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 5, transform = "Integration", sigma = 0.0, exog_count = 100, ar_order = 0); | 38.285714 | 168 | 0.735075 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 5, transform = "Integration", sigma = 0.0, exog_count = 100, ar_order = 0); | true | true |
1c330a28529e1fc48cb5c5a2804c113dc5d0059d | 1,954 | py | Python | lib/gcloud/logging/connection.py | huangkuan/hack | 433e213915749d9c510abf3c7462d5256b5e37eb | [
"Apache-2.0"
] | 1 | 2019-02-06T10:58:11.000Z | 2019-02-06T10:58:11.000Z | lib/gcloud/logging/connection.py | huangkuan/hack | 433e213915749d9c510abf3c7462d5256b5e37eb | [
"Apache-2.0"
] | 4 | 2017-10-24T21:47:53.000Z | 2019-09-22T13:12:57.000Z | lib/gcloud/logging/connection.py | huangkuan/hack | 433e213915749d9c510abf3c7462d5256b5e37eb | [
"Apache-2.0"
] | 2 | 2017-02-09T16:25:27.000Z | 2017-10-24T21:40:42.000Z | # Copyright 2016 Google 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 required by applicable law or a... | 39.877551 | 77 | 0.697544 |
from gcloud import connection as base_connection
class Connection(base_connection.JSONConnection):
API_BASE_URL = 'https://logging.googleapis.com'
API_VERSION = 'v2beta1'
API_URL_TEMPLATE = '{api_base_url}/{api_version}{path}'
SCOPE = ('https://www.googleapis.com/auth/logging.read',... | true | true |
1c330af6422c580419cba5ae220b45442bd3d372 | 24,375 | py | Python | praw/models/reddit/submission.py | RichardHoekstra/praw | 04c3056d146ab905d6b58d6502b8f4d1d9fb4435 | [
"BSD-2-Clause"
] | null | null | null | praw/models/reddit/submission.py | RichardHoekstra/praw | 04c3056d146ab905d6b58d6502b8f4d1d9fb4435 | [
"BSD-2-Clause"
] | null | null | null | praw/models/reddit/submission.py | RichardHoekstra/praw | 04c3056d146ab905d6b58d6502b8f4d1d9fb4435 | [
"BSD-2-Clause"
] | null | null | null | """Provide the Submission class."""
from typing import Any, Dict, List, Optional, TypeVar, Union
from urllib.parse import urljoin
from prawcore import Conflict
from ...const import API_PATH
from ...exceptions import InvalidURL
from ...util.cache import cachedproperty
from ..comment_forest import CommentForest
from ..... | 33.667127 | 85 | 0.581538 | from typing import Any, Dict, List, Optional, TypeVar, Union
from urllib.parse import urljoin
from prawcore import Conflict
from ...const import API_PATH
from ...exceptions import InvalidURL
from ...util.cache import cachedproperty
from ..comment_forest import CommentForest
from ..listing.listing import Listing
from ... | true | true |
1c330b0f0181bf6c532f368e8052f97542502d53 | 79,228 | py | Python | src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py | Arkanayan/azure-cli-extensions | b45ca4061e0428d6438e0a8fb9436994f0205949 | [
"MIT"
] | 4 | 2019-08-20T02:58:03.000Z | 2020-05-22T10:23:11.000Z | src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py | Arkanayan/azure-cli-extensions | b45ca4061e0428d6438e0a8fb9436994f0205949 | [
"MIT"
] | 4 | 2019-08-29T07:20:57.000Z | 2021-12-21T10:04:53.000Z | src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py | Arkanayan/azure-cli-extensions | b45ca4061e0428d6438e0a8fb9436994f0205949 | [
"MIT"
] | 4 | 2019-08-29T02:52:14.000Z | 2021-09-14T10:41:48.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 37.926281 | 126 | 0.607083 |
import importlib
import unittest
from unittest.mock import Mock, patch
import requests
from azext_aks_preview.__init__ import register_aks_preview_resource_type
from azext_aks_preview._client_factory import CUSTOM_MGMT_AKS_PREVIEW
from azext_aks_preview._consts import (
ADDONS,
CONST_ACC_SGX_QUOTE_HELPER_... | true | true |
1c330b1729e9ea2a5375109526f749c310ba72a2 | 9,272 | py | Python | nets.py | asappinc/emergent_comms_negotiation | 19ad405dcb83a3a521b6e1752cec075b69aa164b | [
"MIT"
] | 9 | 2020-03-04T13:24:25.000Z | 2022-03-15T09:52:37.000Z | nets.py | asappinc/emergent_comms_negotiation | 19ad405dcb83a3a521b6e1752cec075b69aa164b | [
"MIT"
] | 2 | 2019-12-30T07:28:33.000Z | 2020-10-13T11:38:34.000Z | nets.py | asappinc/emergent_comms_negotiation | 19ad405dcb83a3a521b6e1752cec075b69aa164b | [
"MIT"
] | 6 | 2018-03-15T18:08:45.000Z | 2019-07-15T06:49:16.000Z | import torch
from torch import nn, autograd
from torch.autograd import Variable
import torch.nn.functional as F
class NumberSequenceEncoder(nn.Module):
def __init__(self, num_values, embedding_size=100):
"""
eg for values 0,1,2,3,4,5, num_values will be: 6
for 0,1,..,9 num_values will be: ... | 36.503937 | 135 | 0.612058 | import torch
from torch import nn, autograd
from torch.autograd import Variable
import torch.nn.functional as F
class NumberSequenceEncoder(nn.Module):
def __init__(self, num_values, embedding_size=100):
super().__init__()
self.embedding_size = embedding_size
self.num_values = num_values
... | true | true |
1c330bb9ecd571857f9b054f2104c084f9a82eb4 | 7,983 | py | Python | Bag of Features/preprocessing_surf.py | varunsingh251/Indian-Sign-Language-Recognition | 07eb060f4c22821e69351b0931ebaadc2e9193a8 | [
"MIT"
] | 147 | 2017-12-08T19:52:18.000Z | 2022-02-23T04:40:02.000Z | Bag of Features/preprocessing_surf.py | hyper07/Indian-Sign-Language-Recognition | 40604e5c0a2a9b6310e26c0fa31b4f4f1c30de45 | [
"MIT"
] | 13 | 2018-01-26T19:21:34.000Z | 2021-11-15T11:53:30.000Z | Bag of Features/preprocessing_surf.py | hyper07/Indian-Sign-Language-Recognition | 40604e5c0a2a9b6310e26c0fa31b4f4f1c30de45 | [
"MIT"
] | 86 | 2017-11-20T10:23:08.000Z | 2022-03-30T14:39:36.000Z | import numpy as np
import cv2
import os
import csv
import sklearn.metrics as sm
from surf_image_processing import func,func2
from sklearn.cluster import MiniBatchKMeans
from sklearn.svm import SVC
from sklearn.grid_search import GridSearchCV
import random
import warnings
import pickle
from sklearn.naive_bayes import Ga... | 36.619266 | 162 | 0.716523 | import numpy as np
import cv2
import os
import csv
import sklearn.metrics as sm
from surf_image_processing import func,func2
from sklearn.cluster import MiniBatchKMeans
from sklearn.svm import SVC
from sklearn.grid_search import GridSearchCV
import random
import warnings
import pickle
from sklearn.naive_bayes import Ga... | true | true |
1c330bd99ebe226153876feb67b2d0e928a6c4c2 | 373 | py | Python | companies/migrations/0012_remove_company_is_listed.py | Valuehorizon/valuehorizon-companies | 5366e230da69ee30fcdc1bf4beddc99310f6b767 | [
"MIT"
] | 1 | 2015-09-28T17:11:12.000Z | 2015-09-28T17:11:12.000Z | companies/migrations/0012_remove_company_is_listed.py | Valuehorizon/valuehorizon-companies | 5366e230da69ee30fcdc1bf4beddc99310f6b767 | [
"MIT"
] | 4 | 2020-02-11T22:59:54.000Z | 2021-06-10T17:55:15.000Z | companies/migrations/0012_remove_company_is_listed.py | Valuehorizon/valuehorizon-companies | 5366e230da69ee30fcdc1bf4beddc99310f6b767 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('companies', '0011_company_latest_incorporation_date'),
]
operations = [
migrations.RemoveField(
model_name='comp... | 19.631579 | 64 | 0.624665 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('companies', '0011_company_latest_incorporation_date'),
]
operations = [
migrations.RemoveField(
model_name='company',
name=... | true | true |
1c330c30ecf527114842ab07626b84a090588d9a | 481 | py | Python | sample_dashboard/sample_dashboard/urls.py | Georgitanev/django_dashboard | 5be2680712fcedf33965fd66a69d46e1e32ab04b | [
"MIT"
] | null | null | null | sample_dashboard/sample_dashboard/urls.py | Georgitanev/django_dashboard | 5be2680712fcedf33965fd66a69d46e1e32ab04b | [
"MIT"
] | null | null | null | sample_dashboard/sample_dashboard/urls.py | Georgitanev/django_dashboard | 5be2680712fcedf33965fd66a69d46e1e32ab04b | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include
from django.urls import path
from django.views.generic import RedirectView
urlpatterns = [
path("admin/", admin.site.urls),
path("google_analytics/", include("google_anal... | 37 | 77 | 0.777547 | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include
from django.urls import path
from django.views.generic import RedirectView
urlpatterns = [
path("admin/", admin.site.urls),
path("google_analytics/", include("google_anal... | true | true |
1c330c5d095231e2570eaac069980322ec14776b | 8,534 | py | Python | releasenotes/source/conf.py | openstack/puppet-rally | f6521d64b11bca1da14a6f7848ba82284b348299 | [
"Apache-2.0"
] | 18 | 2016-01-03T07:26:56.000Z | 2019-04-12T09:22:39.000Z | releasenotes/source/conf.py | openstack/puppet-rally | f6521d64b11bca1da14a6f7848ba82284b348299 | [
"Apache-2.0"
] | null | null | null | releasenotes/source/conf.py | openstack/puppet-rally | f6521d64b11bca1da14a6f7848ba82284b348299 | [
"Apache-2.0"
] | 2 | 2016-01-21T07:39:32.000Z | 2017-06-15T08:18:00.000Z | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 33.206226 | 104 | 0.724045 |
extensions = [
'openstackdocstheme',
'reno.sphinxext',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
copyright = u'2016, Puppet OpenStack Developers'
# |version| and |release|, also used in various other places throughout the
# built docu... | true | true |
1c330c9e85e20a00de1d955a4dbf54c1475c417e | 263 | py | Python | calculator_functions.py | simeckova/special_button_clicker | c49de7b8d18d30327d48ad782e1f2c92e9717da9 | [
"MIT"
] | null | null | null | calculator_functions.py | simeckova/special_button_clicker | c49de7b8d18d30327d48ad782e1f2c92e9717da9 | [
"MIT"
] | null | null | null | calculator_functions.py | simeckova/special_button_clicker | c49de7b8d18d30327d48ad782e1f2c92e9717da9 | [
"MIT"
] | null | null | null | def times_2(n: float) -> float:
return n * 2
def minus_7(n: float) -> float:
return n - 7
def plus_13(n: float) -> float:
return n + 13
def divide_by_3(n: float) -> float:
return n // 3
functions = [times_2, minus_7, plus_13, divide_by_3]
| 14.611111 | 52 | 0.61597 | def times_2(n: float) -> float:
return n * 2
def minus_7(n: float) -> float:
return n - 7
def plus_13(n: float) -> float:
return n + 13
def divide_by_3(n: float) -> float:
return n // 3
functions = [times_2, minus_7, plus_13, divide_by_3]
| true | true |
1c330ceb4e2f4e081fbe6fa36dd495cd2737e107 | 6,686 | py | Python | homeassistant/components/ecobee/weather.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/ecobee/weather.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/ecobee/weather.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Support for displaying weather info from Ecobee API."""
from __future__ import annotations
from datetime import timedelta
from pyecobee.const import ECOBEE_STATE_UNKNOWN
from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION,
ATTR_FORECAST_TEMP,
ATTR_FORECAST_TEMP_LOW,
ATTR_FORECAS... | 30.52968 | 87 | 0.630123 | from __future__ import annotations
from datetime import timedelta
from pyecobee.const import ECOBEE_STATE_UNKNOWN
from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION,
ATTR_FORECAST_TEMP,
ATTR_FORECAST_TEMP_LOW,
ATTR_FORECAST_TIME,
ATTR_FORECAST_WIND_BEARING,
ATTR_FORECAST_W... | true | true |
1c330d018b9287d66eea4498799152cb017ab675 | 928 | py | Python | website/orders/urls.py | KiOui/TOSTI | 72e65889c193727dcf3e3716b10c78a9774e1136 | [
"MIT"
] | 1 | 2020-05-10T21:10:43.000Z | 2020-05-10T21:10:43.000Z | website/orders/urls.py | KiOui/TOSTI | 72e65889c193727dcf3e3716b10c78a9774e1136 | [
"MIT"
] | 158 | 2020-05-04T12:37:41.000Z | 2022-03-31T20:15:07.000Z | website/orders/urls.py | KiOui/TOSTI | 72e65889c193727dcf3e3716b10c78a9774e1136 | [
"MIT"
] | null | null | null | from django.urls import path, register_converter
from orders import views
from .converters import ShiftConverter, OrderVenueConverter, OrderConverter
register_converter(ShiftConverter, "shift")
register_converter(OrderVenueConverter, "order_venue")
register_converter(OrderConverter, "order")
urlpatterns = [
path... | 48.842105 | 100 | 0.75431 | from django.urls import path, register_converter
from orders import views
from .converters import ShiftConverter, OrderVenueConverter, OrderConverter
register_converter(ShiftConverter, "shift")
register_converter(OrderVenueConverter, "order_venue")
register_converter(OrderConverter, "order")
urlpatterns = [
path... | true | true |
1c330d019b36bb4f9d251d15e0a2a2e7de7abdc7 | 3,956 | py | Python | paas-ce/paas/esb/components/bk/apisv2/bk_paas/create_app.py | renmcc/bk-PaaS | 1c9e4e9cfb40fc3375cd6b5f08af8c84203de246 | [
"Apache-2.0"
] | 767 | 2019-03-25T06:35:43.000Z | 2022-03-30T08:57:51.000Z | paas-ce/paas/esb/components/bk/apisv2/bk_paas/create_app.py | renmcc/bk-PaaS | 1c9e4e9cfb40fc3375cd6b5f08af8c84203de246 | [
"Apache-2.0"
] | 194 | 2019-03-29T07:16:41.000Z | 2022-03-30T06:17:49.000Z | paas-ce/paas/esb/components/bk/apisv2/bk_paas/create_app.py | renmcc/bk-PaaS | 1c9e4e9cfb40fc3375cd6b5f08af8c84203de246 | [
"Apache-2.0"
] | 381 | 2019-03-25T07:19:54.000Z | 2022-03-29T03:22:42.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 36.62963 | 305 | 0.566734 |
import json
from django import forms
from components.component import Component
from common.forms import BaseComponentForm, ListField
from common.constants import API_TYPE_OP
from .toolkit import tools, configs
class CreateApp(Component):
sys_name = configs.SYSTEM_NAME
api_type = API_TYPE_OP
host = ... | true | true |
1c330d0afdaba00c48416f6937e6a2dd1a37e0c9 | 4,075 | py | Python | qa/rpc-tests/p2p_node_bloom.py | michailduzhanski/crypto-release | 4e0f14ccc4eaebee6677f06cff4e13f37608c0f8 | [
"MIT"
] | 2 | 2020-02-12T16:22:49.000Z | 2020-02-13T16:34:31.000Z | qa/rpc-tests/p2p_node_bloom.py | michailduzhanski/crypto-release | 4e0f14ccc4eaebee6677f06cff4e13f37608c0f8 | [
"MIT"
] | null | null | null | qa/rpc-tests/p2p_node_bloom.py | michailduzhanski/crypto-release | 4e0f14ccc4eaebee6677f06cff4e13f37608c0f8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2018 The Arnak developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
import sys; assert sys.version_info < (3,), ur"This script does not run under Python 3. Please use Python 2.7.x."
f... | 35.745614 | 113 | 0.672393 |
import sys; assert sys.version_info < (3,), ur"This script does not run under Python 3. Please use Python 2.7.x."
from test_framework.mininode import NodeConn, NodeConnCB, NetworkThread, \
msg_filteradd, msg_filterclear, mininode_lock, SAPLING_PROTO_VERSION
from test_framework.test_framework import BitcoinTes... | false | true |
1c330f8a6990fea6359bab8467d42ea370ce5742 | 1,504 | py | Python | accountifie/common/log.py | imcallister/accountifie | 094834c9d632e0353e3baf8d924eeb10cba0add4 | [
"MIT",
"Unlicense"
] | 4 | 2017-06-02T08:48:48.000Z | 2021-11-21T23:57:15.000Z | accountifie/common/log.py | imcallister/accountifie | 094834c9d632e0353e3baf8d924eeb10cba0add4 | [
"MIT",
"Unlicense"
] | 3 | 2020-06-05T16:55:42.000Z | 2021-06-10T17:43:12.000Z | accountifie/common/log.py | imcallister/accountifie | 094834c9d632e0353e3baf8d924eeb10cba0add4 | [
"MIT",
"Unlicense"
] | 4 | 2015-12-15T14:27:51.000Z | 2017-04-21T21:42:27.000Z | """
Partially adapted with permission from ReportLab's DocEngine framework
"""
import requests
import logging
import json
import traceback
from django.views.debug import get_exception_reporter_filter
from django.conf import settings
class DbLogHandler(logging.Handler):
def emit(self, record):
from .mod... | 29.490196 | 81 | 0.62367 |
import requests
import logging
import json
import traceback
from django.views.debug import get_exception_reporter_filter
from django.conf import settings
class DbLogHandler(logging.Handler):
def emit(self, record):
from .models import Log, Issue
try:
request = record.request
... | true | true |
1c3310046683c750c56af215bc29b813ac883595 | 19,959 | py | Python | zipline/algorithm.py | davidastephens/zipline | 1da206df936bb8125913bae9fc182fd4f611a691 | [
"Apache-2.0"
] | 2 | 2015-12-10T16:25:10.000Z | 2016-02-17T00:18:38.000Z | zipline/algorithm.py | davidastephens/zipline | 1da206df936bb8125913bae9fc182fd4f611a691 | [
"Apache-2.0"
] | null | null | null | zipline/algorithm.py | davidastephens/zipline | 1da206df936bb8125913bae9fc182fd4f611a691 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2013 Quantopian, 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 wr... | 36.488117 | 79 | 0.628288 |
from copy import copy
import pytz
import pandas as pd
import numpy as np
from datetime import datetime
from itertools import groupby, ifilter
from operator import attrgetter
from zipline.errors import (
UnsupportedSlippageModel,
OverrideSlippagePostInit,
UnsupportedCommissionModel,
Ove... | true | true |
1c3310438ac0db658cd7671f27d9557f80502ddf | 691 | py | Python | extract_text_from_pics.py | Jrfix/Extract_Text_From_Pics | d72fca954fd2e1663b3a40c8005f45b6876daf72 | [
"MIT"
] | 1 | 2019-06-05T22:25:14.000Z | 2019-06-05T22:25:14.000Z | extract_text_from_pics.py | Jrfix/Extract_Text_From_Pics | d72fca954fd2e1663b3a40c8005f45b6876daf72 | [
"MIT"
] | null | null | null | extract_text_from_pics.py | Jrfix/Extract_Text_From_Pics | d72fca954fd2e1663b3a40c8005f45b6876daf72 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from PIL import Image
from pytesseract import image_to_string
import sys
import os
import time
from time import sleep
print("Example --> /root/Desktop/")
image_path = raw_input("Image path: ")
print("Example --> picture.png")
image_name = raw_input("Image name: ")
os.s... | 13.288462 | 48 | 0.671491 |
from PIL import Image
from pytesseract import image_to_string
import sys
import os
import time
from time import sleep
print("Example --> /root/Desktop/")
image_path = raw_input("Image path: ")
print("Example --> picture.png")
image_name = raw_input("Image name: ")
os.system("clear")
img = Image.open(image... | true | true |
1c331071f4bf4f4c900885a34d173bfff95f2e89 | 2,832 | py | Python | setup.py | aryabhatt/autocorr-1 | dd47b01498be68d2cd1557b620bc68f4b76c3e11 | [
"BSD-3-Clause"
] | null | null | null | setup.py | aryabhatt/autocorr-1 | dd47b01498be68d2cd1557b620bc68f4b76c3e11 | [
"BSD-3-Clause"
] | null | null | null | setup.py | aryabhatt/autocorr-1 | dd47b01498be68d2cd1557b620bc68f4b76c3e11 | [
"BSD-3-Clause"
] | null | null | null | from os import path
from setuptools import setup, find_packages, Extension
import sys
import versioneer
min_pybind11_version = (2, 3)
# NOTE: This file must remain Python 2 compatible for the foreseeable future,
# to ensure that we error out properly for people with outdated setuptools
# and/or pip.
min_version = (3,... | 31.120879 | 82 | 0.667726 | from os import path
from setuptools import setup, find_packages, Extension
import sys
import versioneer
min_pybind11_version = (2, 3)
min_version = (3, 6)
if sys.version_info < min_version:
error = """
autocorr does not support Python {0}.{1}.
Python {2}.{3} and above is required. Check your Python version lik... | true | true |
1c331147ea30befa010f9a880e04c012fd77ed69 | 2,469 | py | Python | spam.py | redhood-97/sms.ai | 8b787e3f678003826e36e233d966c7108989354c | [
"MIT"
] | null | null | null | spam.py | redhood-97/sms.ai | 8b787e3f678003826e36e233d966c7108989354c | [
"MIT"
] | null | null | null | spam.py | redhood-97/sms.ai | 8b787e3f678003826e36e233d966c7108989354c | [
"MIT"
] | 3 | 2018-05-31T07:04:06.000Z | 2018-10-30T17:42:07.000Z |
import os, csv, re, nltk
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.f... | 20.404959 | 114 | 0.611989 |
import os, csv, re, nltk
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.f... | true | true |
1c3312ed599f7e848d662a175adb396479227a15 | 4,281 | py | Python | set3/CBC_padding_oracle.py | nahgil2614/cryptopals | e1c83d07dacb1c159ab1bbc0532eca8200dedca0 | [
"MIT"
] | null | null | null | set3/CBC_padding_oracle.py | nahgil2614/cryptopals | e1c83d07dacb1c159ab1bbc0532eca8200dedca0 | [
"MIT"
] | null | null | null | set3/CBC_padding_oracle.py | nahgil2614/cryptopals | e1c83d07dacb1c159ab1bbc0532eca8200dedca0 | [
"MIT"
] | null | null | null | import base64
import random
import time
from PKCS7 import valid_pad
from PKCS7 import PKCS7_pad as pad
from AES_CBC import Ciphers
from AES_CBC import InvCiphers
from AES_CBC import KeyExpansion
#const
randKey = bytes([random.getrandbits(8) for i in range(16)])
w = KeyExpansion( randKey )
IV = ''.join([c... | 32.679389 | 97 | 0.512731 | import base64
import random
import time
from PKCS7 import valid_pad
from PKCS7 import PKCS7_pad as pad
from AES_CBC import Ciphers
from AES_CBC import InvCiphers
from AES_CBC import KeyExpansion
randKey = bytes([random.getrandbits(8) for i in range(16)])
w = KeyExpansion( randKey )
IV = ''.join([chr(rand... | true | true |
1c3314374f8fb01f613de63c5fa967af3b8e0188 | 7,367 | py | Python | trainer/loss.py | keshav47/mildnet | c5a95da78039bea605b75ce3ed2af6fe310f36f6 | [
"Apache-2.0"
] | 77 | 2019-03-07T12:18:47.000Z | 2022-03-28T08:21:55.000Z | trainer/loss.py | keshav47/mildnet | c5a95da78039bea605b75ce3ed2af6fe310f36f6 | [
"Apache-2.0"
] | 23 | 2019-05-17T11:23:02.000Z | 2022-03-11T23:42:29.000Z | trainer/loss.py | keshav47/mildnet | c5a95da78039bea605b75ce3ed2af6fe310f36f6 | [
"Apache-2.0"
] | 29 | 2019-03-11T02:41:42.000Z | 2022-02-07T15:37:24.000Z | from tensorflow.keras import backend as K
import tensorflow as tf
_EPSILON = K.epsilon()
def hinge_loss_fn(batch_size):
def hinge_loss(y_true, y_pred):
y_pred = K.clip(y_pred, _EPSILON, 1.0-_EPSILON)
loss = tf.convert_to_tensor(0,dtype=tf.float32)
g = tf.constant(1.0, shape=[1], dtype=tf.... | 38.570681 | 109 | 0.539297 | from tensorflow.keras import backend as K
import tensorflow as tf
_EPSILON = K.epsilon()
def hinge_loss_fn(batch_size):
def hinge_loss(y_true, y_pred):
y_pred = K.clip(y_pred, _EPSILON, 1.0-_EPSILON)
loss = tf.convert_to_tensor(0,dtype=tf.float32)
g = tf.constant(1.0, shape=[1], dtype=tf.... | true | true |
1c3314cfa907a66f629e785eaa51462cbe241442 | 1,072 | py | Python | src/base.py | DrFargo/Starship-Simulation | ff1c30cd8227c7041357a1e2da2fcb34ab06a757 | [
"MIT"
] | null | null | null | src/base.py | DrFargo/Starship-Simulation | ff1c30cd8227c7041357a1e2da2fcb34ab06a757 | [
"MIT"
] | null | null | null | src/base.py | DrFargo/Starship-Simulation | ff1c30cd8227c7041357a1e2da2fcb34ab06a757 | [
"MIT"
] | null | null | null | ## Author DrFargo
## Created: 2021-02-07
## Latest update: 2021-02-12
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import scipy.linalg as la
import matplotlib.pyplot as plt
class starshipSimulation:
def parameters(self, g, lox, engines):
gravity = g
tlo... | 26.146341 | 45 | 0.545709 | port numpy as np
import scipy.linalg as la
import matplotlib.pyplot as plt
class starshipSimulation:
def parameters(self, g, lox, engines):
gravity = g
tlox = lox
rapteng = engines*2.3
m_fuel = 1.8
m_ox = 2.2
def Render(self, filenam... | true | true |
1c331613d3b8ca181851d6b069742635a6769333 | 1,134 | py | Python | bot/cogs/Cogs/__init__.py | abindent/Utility-Bot | a11b790e7930a035fdca2b153950e624e3abafe4 | [
"MIT"
] | 2 | 2022-03-20T13:12:35.000Z | 2022-03-27T08:52:37.000Z | bot/cogs/Cogs/__init__.py | abindent/Nextcord-Utility-Bot | a11b790e7930a035fdca2b153950e624e3abafe4 | [
"MIT"
] | 2 | 2022-03-07T01:10:21.000Z | 2022-03-08T07:33:06.000Z | bot/cogs/Cogs/__init__.py | abindent/Utility-Bot | a11b790e7930a035fdca2b153950e624e3abafe4 | [
"MIT"
] | 1 | 2022-03-08T07:41:46.000Z | 2022-03-08T07:41:46.000Z | import nextcord
from nextcord.ext import commands
class CogSetup(commands.Cog, name="Extension Setup", description="Load, Unload or Reload the extensions."):
def __init__(self, bot):
self.bot = bot
COG_EMOJI = "⚙️"
# Load Command
@commands.command(name="load", description="Load t... | 34.363636 | 107 | 0.663139 | import nextcord
from nextcord.ext import commands
class CogSetup(commands.Cog, name="Extension Setup", description="Load, Unload or Reload the extensions."):
def __init__(self, bot):
self.bot = bot
COG_EMOJI = "⚙️"
@commands.command(name="load", description="Load the cogs.", usa... | true | true |
1c331618c8fa5a71c5b4d40f6f354c23efb05154 | 601 | py | Python | AtCoder/ABC045/D.py | takaaki82/Java-Lessons | c4f11462bf84c091527dde5f25068498bfb2cc49 | [
"MIT"
] | 1 | 2018-11-25T04:15:45.000Z | 2018-11-25T04:15:45.000Z | AtCoder/ABC045/D.py | takaaki82/Java-Lessons | c4f11462bf84c091527dde5f25068498bfb2cc49 | [
"MIT"
] | null | null | null | AtCoder/ABC045/D.py | takaaki82/Java-Lessons | c4f11462bf84c091527dde5f25068498bfb2cc49 | [
"MIT"
] | 2 | 2018-08-08T13:01:14.000Z | 2018-11-25T12:38:36.000Z | H, W, N = map(int, input().split())
ab = []
for i in range(N):
a, b = map(int, input().split())
ab.append((a - 1, b - 1))
comb_map = {}
for a, b in ab:
for k in range(3):
for m in range(3):
if 0 <= a - k < H - 2 and 0 <= b - m < W - 2:
if (a - k, b - m) in comb_map.keys... | 22.259259 | 57 | 0.417637 | H, W, N = map(int, input().split())
ab = []
for i in range(N):
a, b = map(int, input().split())
ab.append((a - 1, b - 1))
comb_map = {}
for a, b in ab:
for k in range(3):
for m in range(3):
if 0 <= a - k < H - 2 and 0 <= b - m < W - 2:
if (a - k, b - m) in comb_map.keys... | true | true |
1c331652aac3fe02dca4d80a87a46912b21c30c3 | 5,214 | py | Python | installation/migrations/dbschema.files-and-directories.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | 216 | 2015-01-05T12:48:10.000Z | 2022-03-08T00:12:23.000Z | installation/migrations/dbschema.files-and-directories.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | 55 | 2015-02-28T12:10:26.000Z | 2020-11-18T17:45:16.000Z | installation/migrations/dbschema.files-and-directories.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | 34 | 2015-05-02T15:15:10.000Z | 2020-06-15T19:20:37.000Z | # -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2013 Jens Lindström, Opera Software ASA
#
# 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... | 40.418605 | 116 | 0.75163 |
import sys
import psycopg2
import json
import argparse
import os
parser = argparse.ArgumentParser()
parser.add_argument("--uid", type=int)
parser.add_argument("--gid", type=int)
arguments = parser.parse_args()
os.setgid(arguments.gid)
os.setuid(arguments.uid)
data = json.load(sys.stdin)
import conf... | true | true |
1c3316737fce0dbb30450130ad8d0edd48534733 | 1,194 | py | Python | setup.py | bentetamas/tinycards-python-api | 98c35c8b1fbad28fcc61c01cbdae7e092e779a62 | [
"MIT"
] | null | null | null | setup.py | bentetamas/tinycards-python-api | 98c35c8b1fbad28fcc61c01cbdae7e092e779a62 | [
"MIT"
] | null | null | null | setup.py | bentetamas/tinycards-python-api | 98c35c8b1fbad28fcc61c01cbdae7e092e779a62 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
NAME = 'tinycards'
setup(
name=NAME,
version='0.281',
description="An unofficial Python API for Tinycards by Duolingo",
url='https://github.com/floscha/tinycards-python-api',
author='Florian Schäfer',
author_email='florian.joh.schaefer@gmail.com',
... | 29.85 | 69 | 0.586265 | from setuptools import setup, find_packages
NAME = 'tinycards'
setup(
name=NAME,
version='0.281',
description="An unofficial Python API for Tinycards by Duolingo",
url='https://github.com/floscha/tinycards-python-api',
author='Florian Schäfer',
author_email='florian.joh.schaefer@gmail.com',
... | true | true |
1c3318416dc8b7805443ceeac11a29cef738ae32 | 1,225 | py | Python | NesaraTours/migrations/0002_auto_20200831_0946.py | Annonymus-Coder/Tours-And-Travels-project | 81fce5c24599895b6526eeb28bd4582b5d55948b | [
"MIT"
] | null | null | null | NesaraTours/migrations/0002_auto_20200831_0946.py | Annonymus-Coder/Tours-And-Travels-project | 81fce5c24599895b6526eeb28bd4582b5d55948b | [
"MIT"
] | null | null | null | NesaraTours/migrations/0002_auto_20200831_0946.py | Annonymus-Coder/Tours-And-Travels-project | 81fce5c24599895b6526eeb28bd4582b5d55948b | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-08-31 04:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('auth', '0012_al... | 32.236842 | 125 | 0.601633 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('auth', '0012_alter_user_first_name_max_length'),
('N... | true | true |
1c3318ca5161384c5534f50a78303c641566d024 | 324 | py | Python | redcmd/client/__main__.py | amol9/redcmd | 34086eb42ec6acc16dbd2b3ea530898a6a287639 | [
"MIT"
] | 1 | 2015-10-26T19:38:28.000Z | 2015-10-26T19:38:28.000Z | redcmd/client/__main__.py | amol9/redcmd | 34086eb42ec6acc16dbd2b3ea530898a6a287639 | [
"MIT"
] | null | null | null | redcmd/client/__main__.py | amol9/redcmd | 34086eb42ec6acc16dbd2b3ea530898a6a287639 | [
"MIT"
] | null | null | null |
from .. import CommandLine, CommandLineError, Subcommand, subcmd
from ..version import __version__
from .autocomp_subcommand import *
from .init_subcommand import *
cmdline = CommandLine(prog='redcmd', description='redcmd client.',
version=__version__)
try:
cmdline.execute()
except CommandLineError as e:
print(... | 20.25 | 66 | 0.777778 |
from .. import CommandLine, CommandLineError, Subcommand, subcmd
from ..version import __version__
from .autocomp_subcommand import *
from .init_subcommand import *
cmdline = CommandLine(prog='redcmd', description='redcmd client.',
version=__version__)
try:
cmdline.execute()
except CommandLineError as e:
print(... | true | true |
1c33198acec018137f92a47269f0ef6f6b75370d | 1,323 | py | Python | accounts/forms.py | Paul-Cheeseman/Stream3-Project | 174fa1d6bbf9ed75748513af366629ed01dddfee | [
"BSD-3-Clause"
] | null | null | null | accounts/forms.py | Paul-Cheeseman/Stream3-Project | 174fa1d6bbf9ed75748513af366629ed01dddfee | [
"BSD-3-Clause"
] | 8 | 2020-02-12T00:52:56.000Z | 2022-03-11T23:23:20.000Z | accounts/forms.py | Paul-Cheeseman/Stream3-Project | 174fa1d6bbf9ed75748513af366629ed01dddfee | [
"BSD-3-Clause"
] | 1 | 2018-02-22T11:15:48.000Z | 2018-02-22T11:15:48.000Z | from django import forms
from django.contrib.auth.forms import UserCreationForm
from accounts.models import User
#User Registration form - based on code from Code Institute
class UserRegistrationForm(UserCreationForm):
password1 = forms.CharField(
label='Password',
widget=forms.PasswordInput
)
... | 25.941176 | 74 | 0.662887 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from accounts.models import User
class UserRegistrationForm(UserCreationForm):
password1 = forms.CharField(
label='Password',
widget=forms.PasswordInput
)
password2 = forms.CharField(
label='Password ... | true | true |
1c3319ce9f23f6f47aafb85e691db243fef0398c | 1,738 | py | Python | Gathered CTF writeups/ptr-yudai-writeups/2019/InCTF_2019/schmaltz/solve.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | 1 | 2022-03-27T06:00:41.000Z | 2022-03-27T06:00:41.000Z | Gathered CTF writeups/ptr-yudai-writeups/2019/InCTF_2019/schmaltz/solve.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | null | null | null | Gathered CTF writeups/ptr-yudai-writeups/2019/InCTF_2019/schmaltz/solve.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | 1 | 2022-03-27T06:01:42.000Z | 2022-03-27T06:01:42.000Z | from ptrlib import *
def add(size, data):
sock.sendlineafter("> ", "1")
sock.sendlineafter("> ", str(size))
if size > 0:
sock.sendafter("> ", data)
return
def view(index):
sock.sendlineafter("> ", "3")
sock.sendlineafter("> ", str(index))
sock.recvuntil("Content: ")
return sock... | 22 | 61 | 0.623705 | from ptrlib import *
def add(size, data):
sock.sendlineafter("> ", "1")
sock.sendlineafter("> ", str(size))
if size > 0:
sock.sendafter("> ", data)
return
def view(index):
sock.sendlineafter("> ", "3")
sock.sendlineafter("> ", str(index))
sock.recvuntil("Content: ")
return sock... | true | true |
1c3319d1b95ffbb366d5639dab284adc07453f08 | 641 | py | Python | src/test.py | erikmetzinfo/tds_db_generator | 1082a670f1ecd46c2dc7f0ebe8baccdcaf70a867 | [
"MIT"
] | null | null | null | src/test.py | erikmetzinfo/tds_db_generator | 1082a670f1ecd46c2dc7f0ebe8baccdcaf70a867 | [
"MIT"
] | null | null | null | src/test.py | erikmetzinfo/tds_db_generator | 1082a670f1ecd46c2dc7f0ebe8baccdcaf70a867 | [
"MIT"
] | null | null | null |
from general_pkg import string_comparison
from fuzzywuzzy import process as fuzzy_process
a = 'Ratio by weight ( A / B ) 100/ 9505'
a = 'Ratio by weight ( A / B ) 100/ 9505'
b = 'Ratio by weight ( A / B )'
match, match_ratio = string_comparison(a,b,max_value=95)
def special_string_comparison(string1, string2):
... | 26.708333 | 56 | 0.659906 |
from general_pkg import string_comparison
from fuzzywuzzy import process as fuzzy_process
a = 'Ratio by weight ( A / B ) 100/ 9505'
a = 'Ratio by weight ( A / B ) 100/ 9505'
b = 'Ratio by weight ( A / B )'
match, match_ratio = string_comparison(a,b,max_value=95)
def special_string_comparison(string1, string2):
... | true | true |
1c331a30f7049c48688de08a8d07b2dec8e1d49a | 981 | py | Python | scraper/storage_spiders/thanhhuongshoescom.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | null | null | null | scraper/storage_spiders/thanhhuongshoescom.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 10 | 2020-02-11T23:34:28.000Z | 2022-03-11T23:16:12.000Z | scraper/storage_spiders/thanhhuongshoescom.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 3 | 2018-08-05T14:54:25.000Z | 2021-06-07T01:49:59.000Z | # Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//h1",
'price' : "//em[@class='ProductPrice VariationProductPrice']",
'category' : "//div[@id='Breadcrumb']/ul/li/a",
'descrip... | 36.333333 | 98 | 0.651376 |
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//h1",
'price' : "//em[@class='ProductPrice VariationProductPrice']",
'category' : "//div[@id='Breadcrumb']/ul/li/a",
'description' : "//div[@id='ProductDescription']/div[@class='ProductDescriptionConta... | true | true |
1c331a47640bd205d642269fb7ca24e833c01fa8 | 419 | py | Python | ex011.py | erikamaylim/Python-CursoemVideo | 5a6809818c4c55a02ec52379d95f3d20c833df2e | [
"MIT"
] | null | null | null | ex011.py | erikamaylim/Python-CursoemVideo | 5a6809818c4c55a02ec52379d95f3d20c833df2e | [
"MIT"
] | null | null | null | ex011.py | erikamaylim/Python-CursoemVideo | 5a6809818c4c55a02ec52379d95f3d20c833df2e | [
"MIT"
] | null | null | null | """Faça um programa que leia a largura e a altura de uma parede em metros,
calcule a sua área e a quantidade de tinta necessária para pintá-la,
sabendo que cada litro de tinta pinta uma área de 2 metros quadrados."""
l = float(input('Digite a largura em metros: '))
h = float(input('Digite a altura em metros: '))
a = l... | 41.9 | 83 | 0.699284 |
l = float(input('Digite a largura em metros: '))
h = float(input('Digite a altura em metros: '))
a = l * h
t = a / 2
print('A área tem {:.2f}m² e são necessários {:.2f} litros de tinta.'.format(a, t))
| true | true |
1c331a4818a19d2eb248b16229fc321ce8b19a30 | 10,343 | py | Python | myven/lib/python3.8/site-packages/ansible/modules/cloud/azure/azure_rm_mysqldatabase.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | myven/lib/python3.8/site-packages/ansible/modules/cloud/azure/azure_rm_mysqldatabase.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | null | null | null | myven/lib/python3.8/site-packages/ansible/modules/cloud/azure/azure_rm_mysqldatabase.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 34.824916 | 152 | 0.577202 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: azure_rm_mysqldatabase
version_added: "2.5"
short_des... | true | true |
1c331b0913f847b13de2e972bc7a00bde2fbf4db | 47,483 | py | Python | jenkins_jobs/modules/project_multibranch.py | knorx/jenkins-job-builder | d15e57a14a7aa6a9de674479e1dcb904a8c09942 | [
"Apache-2.0"
] | 3 | 2019-03-03T20:15:29.000Z | 2020-11-17T18:48:27.000Z | jenkins_jobs/modules/project_multibranch.py | knorx/jenkins-job-builder | d15e57a14a7aa6a9de674479e1dcb904a8c09942 | [
"Apache-2.0"
] | null | null | null | jenkins_jobs/modules/project_multibranch.py | knorx/jenkins-job-builder | d15e57a14a7aa6a9de674479e1dcb904a8c09942 | [
"Apache-2.0"
] | 1 | 2019-02-21T22:59:17.000Z | 2019-02-21T22:59:17.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Joost van der Griendt <joostvdg@gmail.com>
# Copyright (C) 2018 Sorin Sbarnea <ssbarnea@users.noreply.github.com>
#
# 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... | 39.701505 | 79 | 0.582609 |
import collections
import logging
import xml.etree.ElementTree as XML
import jenkins_jobs.modules.base
import jenkins_jobs.modules.helpers as helpers
import six
from jenkins_jobs.modules.scm import git_extensions
from jenkins_jobs.errors import InvalidAttributeError
logger = logging.getLogger(str(__n... | true | true |
1c331b7cfdd6aa03faae6c1b5bc0b4e9acbe92d9 | 14,571 | py | Python | venv/lib/python3.8/site-packages/statsmodels/sandbox/panel/panelmod.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 6,931 | 2015-01-01T11:41:55.000Z | 2022-03-31T17:03:24.000Z | venv/lib/python3.8/site-packages/statsmodels/sandbox/panel/panelmod.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 6,137 | 2015-01-01T00:33:45.000Z | 2022-03-31T22:53:17.000Z | venv/lib/python3.8/site-packages/statsmodels/sandbox/panel/panelmod.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 2,608 | 2015-01-02T21:32:31.000Z | 2022-03-31T07:38:30.000Z | """
Sandbox Panel Estimators
References
-----------
Baltagi, Badi H. `Econometric Analysis of Panel Data.` 4th ed. Wiley, 2008.
"""
from functools import reduce
import numpy as np
from statsmodels.regression.linear_model import GLS
__all__ = ["PanelModel"]
from pandas import Panel
def group(X):
"""
Retu... | 32.966063 | 78 | 0.606135 | from functools import reduce
import numpy as np
from statsmodels.regression.linear_model import GLS
__all__ = ["PanelModel"]
from pandas import Panel
def group(X):
uniq_dict = {}
group = np.zeros(len(X))
for i in range(len(X)):
if not X[i] in uniq_dict:
uniq_dict.update({X[i] : len... | true | true |
1c331bf1d66060169113b764d33287441ab11a06 | 139 | py | Python | InClass/Day24/05.py | walkingtyphoon/Python-workspace | e872bce82b2bac3dd5d809f8576345ccc1c6afb7 | [
"Apache-2.0"
] | null | null | null | InClass/Day24/05.py | walkingtyphoon/Python-workspace | e872bce82b2bac3dd5d809f8576345ccc1c6afb7 | [
"Apache-2.0"
] | null | null | null | InClass/Day24/05.py | walkingtyphoon/Python-workspace | e872bce82b2bac3dd5d809f8576345ccc1c6afb7 | [
"Apache-2.0"
] | null | null | null | value = input("请输入你需要辨别的字符:")
print(value.isdigit())
# 判断是否为数字
print(value.isalpha())
# 判断是否为字母
print(value.isspace())
# 判断是否为空格或者是制表符,空格
| 15.444444 | 29 | 0.726619 | value = input("请输入你需要辨别的字符:")
print(value.isdigit())
print(value.isalpha())
print(value.isspace())
| true | true |
1c331d68032e12d278f28e029f665df346a53f5d | 42,579 | py | Python | django/views/debug.py | skyl/django | 843e7450ddcb820b2bdc6d47d6c4aab9820a46c4 | [
"BSD-3-Clause"
] | 1 | 2021-11-22T17:41:19.000Z | 2021-11-22T17:41:19.000Z | django/views/debug.py | skyl/django | 843e7450ddcb820b2bdc6d47d6c4aab9820a46c4 | [
"BSD-3-Clause"
] | null | null | null | django/views/debug.py | skyl/django | 843e7450ddcb820b2bdc6d47d6c4aab9820a46c4 | [
"BSD-3-Clause"
] | 1 | 2020-06-03T07:55:20.000Z | 2020-06-03T07:55:20.000Z | from __future__ import unicode_literals
import datetime
import os
import re
import sys
import types
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import (HttpResponse, HttpResponseServerError,
HttpResponseNotFound, HttpRequest, build_request_repr)
from d... | 38.324932 | 251 | 0.594307 | from __future__ import unicode_literals
import datetime
import os
import re
import sys
import types
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import (HttpResponse, HttpResponseServerError,
HttpResponseNotFound, HttpRequest, build_request_repr)
from d... | true | true |
1c331d725ab785933f4f8fd885d27ab580d5d5b5 | 34 | py | Python | code/answer_4-2-4.py | KoyanagiHitoshi/AtCoder-Python-Introduction | 6d014e333a873f545b4d32d438e57cf428b10b96 | [
"MIT"
] | 1 | 2022-03-29T13:50:12.000Z | 2022-03-29T13:50:12.000Z | code/answer_4-2-4.py | KoyanagiHitoshi/AtCoder-Python-Introduction | 6d014e333a873f545b4d32d438e57cf428b10b96 | [
"MIT"
] | null | null | null | code/answer_4-2-4.py | KoyanagiHitoshi/AtCoder-Python-Introduction | 6d014e333a873f545b4d32d438e57cf428b10b96 | [
"MIT"
] | null | null | null | S, T = input().split()
print(T+S)
| 11.333333 | 22 | 0.558824 | S, T = input().split()
print(T+S)
| true | true |
1c331d987ad5b34a2b09716f44ad466887f0b6b2 | 2,424 | py | Python | api/blog.py | yezz123/DogeAPI | 91e719ad8f252578728ee2a427fd6b733f0cf2a8 | [
"MIT"
] | 93 | 2021-05-13T00:13:19.000Z | 2022-03-30T03:55:09.000Z | api/blog.py | yezz123/DogeAPI | 91e719ad8f252578728ee2a427fd6b733f0cf2a8 | [
"MIT"
] | 17 | 2021-05-16T14:49:24.000Z | 2021-10-18T23:29:48.000Z | api/blog.py | yezz123/DogeAPI | 91e719ad8f252578728ee2a427fd6b733f0cf2a8 | [
"MIT"
] | 22 | 2021-05-13T08:32:59.000Z | 2022-02-23T13:07:05.000Z | #!/usr/bin/python3
from fastapi import HTTPException, status
from sqlalchemy.orm import Session
from models import models
from schema import schemas
def get_all(db: Session):
"""
Get all blogs
Args:
db (Session): Database session
Returns:
List[models.Blog]: List of blogs
"""
... | 21.263158 | 88 | 0.604373 |
from fastapi import HTTPException, status
from sqlalchemy.orm import Session
from models import models
from schema import schemas
def get_all(db: Session):
return db.query(models.Blog).all()
def create(request: schemas.Blog, db: Session):
new_blog = models.Blog(title=request.title, body=request.body, use... | true | true |
1c331dc6c1d546c5e719dd970de5dc96e49ca31d | 4,429 | py | Python | art/defences/thermometer_encoding.py | lr2582858/adversarial-robustness-toolbox | ee3b7ac1ef21fcfd21501070aff2f8eb9db70301 | [
"MIT"
] | 1 | 2018-11-23T06:44:43.000Z | 2018-11-23T06:44:43.000Z | art/defences/thermometer_encoding.py | lr2582858/adversarial-robustness-toolbox | ee3b7ac1ef21fcfd21501070aff2f8eb9db70301 | [
"MIT"
] | null | null | null | art/defences/thermometer_encoding.py | lr2582858/adversarial-robustness-toolbox | ee3b7ac1ef21fcfd21501070aff2f8eb9db70301 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (C) IBM Corporation 2018
#
# 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... | 36.908333 | 120 | 0.665613 |
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import numpy as np
from art.defences.preprocessor import Preprocessor
from art.utils import to_categorical
from art import NUMPY_DTYPE
logger = logging.getLogger(__name__)
class ThermometerEncoding(P... | true | true |
1c331ddb1997d4e4af5fb713910dc8fbb5641f67 | 1,129 | py | Python | girder/molecules/molecules/utilities/pagination.py | bnmajor/mongochemserver | aa76ab6e7f749c3e893f27e208984b6ed2d4b2b5 | [
"BSD-3-Clause"
] | 14 | 2015-05-04T16:40:48.000Z | 2021-07-13T08:00:30.000Z | girder/molecules/molecules/utilities/pagination.py | bnmajor/mongochemserver | aa76ab6e7f749c3e893f27e208984b6ed2d4b2b5 | [
"BSD-3-Clause"
] | 88 | 2015-07-24T07:58:43.000Z | 2021-02-23T19:37:13.000Z | girder/molecules/molecules/utilities/pagination.py | bnmajor/mongochemserver | aa76ab6e7f749c3e893f27e208984b6ed2d4b2b5 | [
"BSD-3-Clause"
] | 8 | 2015-06-12T20:54:39.000Z | 2021-04-09T01:07:15.000Z | from girder.constants import SortDir
def default_pagination_params(limit=None, offset=None, sort=None):
"""Returns default params unless they are set"""
if limit is None:
limit = 25
if offset is None:
offset = 0
if sort is None:
sort = [('_id', SortDir.DESCENDING)]
return l... | 28.225 | 67 | 0.612046 | from girder.constants import SortDir
def default_pagination_params(limit=None, offset=None, sort=None):
if limit is None:
limit = 25
if offset is None:
offset = 0
if sort is None:
sort = [('_id', SortDir.DESCENDING)]
return limit, offset, sort
def parse_pagination_params(param... | true | true |
1c331ddd38ebe454abfa15a1da7a1654eb669ea7 | 753 | py | Python | Chapter 6/glossary.py | WilliamJaber/Python-Crash-Course | d87621785011039fbe0b42f0d8b6cd2364246577 | [
"MIT"
] | null | null | null | Chapter 6/glossary.py | WilliamJaber/Python-Crash-Course | d87621785011039fbe0b42f0d8b6cd2364246577 | [
"MIT"
] | null | null | null | Chapter 6/glossary.py | WilliamJaber/Python-Crash-Course | d87621785011039fbe0b42f0d8b6cd2364246577 | [
"MIT"
] | 5 | 2021-09-22T16:53:47.000Z | 2022-03-24T00:56:49.000Z | glossary = {
'integer': 'is colloquially defined as a number that can be written without a fractional component.\n',
'iterate': 'is the repetition of a process in order to generate a sequence of outcomes.\n',
'indentation': 'is an empty space at the beginning of a line that groups particular blocks of code.... | 53.785714 | 107 | 0.707835 | glossary = {
'integer': 'is colloquially defined as a number that can be written without a fractional component.\n',
'iterate': 'is the repetition of a process in order to generate a sequence of outcomes.\n',
'indentation': 'is an empty space at the beginning of a line that groups particular blocks of code.... | true | true |
1c331edf3f31abdaae2975dbc1c63f484ebad872 | 1,409 | py | Python | generate_tsv.py | mr-martian/PTNK | beb162053af8f73dd276d72205eab4ff28591c64 | [
"MIT"
] | null | null | null | generate_tsv.py | mr-martian/PTNK | beb162053af8f73dd276d72205eab4ff28591c64 | [
"MIT"
] | null | null | null | generate_tsv.py | mr-martian/PTNK | beb162053af8f73dd276d72205eab4ff28591c64 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import yaml
def extract_lang(blob, lang):
if lang not in blob:
return []
ret = []
dct = {}
n = 0
for k in blob[lang]:
n1, n2 = blob[lang][k].split('-')
n = max(n, int(n2))
for i in range(int(n1), int(n2)+1):
dct[i] = k
for i in... | 27.627451 | 73 | 0.568488 |
import yaml
def extract_lang(blob, lang):
if lang not in blob:
return []
ret = []
dct = {}
n = 0
for k in blob[lang]:
n1, n2 = blob[lang][k].split('-')
n = max(n, int(n2))
for i in range(int(n1), int(n2)+1):
dct[i] = k
for i in range(1, n+1):
... | true | true |
1c331efec726708105560f1ead5a3cb0947f2d57 | 2,841 | py | Python | xenon_worker/commands/module.py | NicCardozo/xenon-worker | 90915e9738234db28a7a2dea63dd1f5fa7a5ecea | [
"MIT"
] | 17 | 2020-05-07T14:51:14.000Z | 2022-03-21T16:37:10.000Z | xenon_worker/commands/module.py | NicCardozo/xenon-worker | 90915e9738234db28a7a2dea63dd1f5fa7a5ecea | [
"MIT"
] | 5 | 2020-10-16T13:54:54.000Z | 2020-12-21T15:13:31.000Z | xenon_worker/commands/module.py | NicCardozo/xenon-worker | 90915e9738234db28a7a2dea63dd1f5fa7a5ecea | [
"MIT"
] | 7 | 2020-05-15T14:19:20.000Z | 2021-10-14T03:43:34.000Z | from .command import Command
from datetime import timedelta, datetime
import traceback
import asyncio
class Task:
def __init__(self, callback, delta=True, **units):
self.delta = delta
self.callback = callback
self.units = units
self.module = None # Gets filled by bot.add_module
... | 25.366071 | 65 | 0.560366 | from .command import Command
from datetime import timedelta, datetime
import traceback
import asyncio
class Task:
def __init__(self, callback, delta=True, **units):
self.delta = delta
self.callback = callback
self.units = units
self.module = None
@property
def time_to_wa... | true | true |
1c331f3d5b497a66325b056d47f208d9d3525d44 | 4,804 | py | Python | DataStructures/DoubleLinkedList.py | jamwine/Data-Structures-and-Algorithm | 9e1377701d7ea60557130e08fca59b1f9ee2ddab | [
"MIT"
] | null | null | null | DataStructures/DoubleLinkedList.py | jamwine/Data-Structures-and-Algorithm | 9e1377701d7ea60557130e08fca59b1f9ee2ddab | [
"MIT"
] | null | null | null | DataStructures/DoubleLinkedList.py | jamwine/Data-Structures-and-Algorithm | 9e1377701d7ea60557130e08fca59b1f9ee2ddab | [
"MIT"
] | 1 | 2020-06-19T19:54:26.000Z | 2020-06-19T19:54:26.000Z | class DoublyLinkedListNode:
def __init__(self,value):
self.info=value
self.prev=None
self.next=None
class DoubleLinkedList:
def __init__(self):
self.start=None
def display_list(self):
if self.start is None:
print("List is empty.")
... | 25.827957 | 80 | 0.466694 | class DoublyLinkedListNode:
def __init__(self,value):
self.info=value
self.prev=None
self.next=None
class DoubleLinkedList:
def __init__(self):
self.start=None
def display_list(self):
if self.start is None:
print("List is empty.")
... | true | true |
1c3320d62c581e4c4d90edc647893f6ef53ad9c8 | 1,416 | py | Python | src/Loss.py | roshan19041/Causal-Discovery | 900cfc94d9fc3ff3d75366b00bda3acd044ed638 | [
"MIT"
] | 1 | 2020-07-20T00:00:31.000Z | 2020-07-20T00:00:31.000Z | src/Loss.py | roshan19041/Causal-Discovery | 900cfc94d9fc3ff3d75366b00bda3acd044ed638 | [
"MIT"
] | null | null | null | src/Loss.py | roshan19041/Causal-Discovery | 900cfc94d9fc3ff3d75366b00bda3acd044ed638 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 23 18:59:20 2019
@author: roshanprakash
"""
import tensorflow as tf
def compute_loss(generated_data, observed_data):
"""
Computes the Maximum Mean Discrepancy between generated data and observational data.
PARAMETERS
----------... | 38.27027 | 103 | 0.653249 |
import tensorflow as tf
def compute_loss(generated_data, observed_data):
N = tf.cast(tf.shape(observed_data)[0], dtype=tf.float32)
GAMMA = tf.constant(0.01, dtype=tf.float32, name='gamma')
MULTIPLIERS = tf.concat([tf.ones([N, 1])/N, tf.ones([N, 1])/-N], axis=0)
X = tf.concat(values=[generated_data, o... | true | true |
1c33219ed2e9b4b02b73a62e759b3bb6b3f1a3e0 | 5,242 | py | Python | api/admin/controller/discovery_service_library_registrations.py | aseefahmed/circulation | 17cbc9186ab3cde9606912559f92b393ac18ecaa | [
"Apache-2.0"
] | null | null | null | api/admin/controller/discovery_service_library_registrations.py | aseefahmed/circulation | 17cbc9186ab3cde9606912559f92b393ac18ecaa | [
"Apache-2.0"
] | 44 | 2022-01-20T01:31:32.000Z | 2022-03-31T01:50:41.000Z | api/admin/controller/discovery_service_library_registrations.py | jonathangreen/circulation | 118866f8257e2a97431a28ea5ba8e34e5bd393eb | [
"Apache-2.0"
] | null | null | null | import json
import flask
from flask import Response
from flask_babel import lazy_gettext as _
from api.admin.problem_details import *
from api.registration.registry import Registration, RemoteRegistry
from core.model import ExternalIntegration, Library, get_one
from core.util.http import HTTP
from core.util.problem_d... | 37.71223 | 97 | 0.660816 | import json
import flask
from flask import Response
from flask_babel import lazy_gettext as _
from api.admin.problem_details import *
from api.registration.registry import Registration, RemoteRegistry
from core.model import ExternalIntegration, Library, get_one
from core.util.http import HTTP
from core.util.problem_d... | true | true |
1c3321ab02b21c65c4f5b04f4c9668d8d0636669 | 1,063 | py | Python | tf1x/schematic_utils/toy/util.py | dpaiton/DeepSparseCoding | 5ea01fa8770794df5e13743aa3f2d85297c27eb1 | [
"MIT"
] | 12 | 2017-04-27T17:19:31.000Z | 2021-11-07T03:37:59.000Z | tf1x/schematic_utils/toy/util.py | dpaiton/DeepSparseCoding | 5ea01fa8770794df5e13743aa3f2d85297c27eb1 | [
"MIT"
] | 12 | 2018-03-21T01:16:25.000Z | 2022-02-10T00:21:58.000Z | tf1x/schematic_utils/toy/util.py | dpaiton/DeepSparseCoding | 5ea01fa8770794df5e13743aa3f2d85297c27eb1 | [
"MIT"
] | 12 | 2017-02-01T19:49:57.000Z | 2021-12-08T03:16:58.000Z | from itertools import product
import autograd
import autograd.numpy as np
def orthogonalize(twovector):
return np.asarray([-twovector[1], twovector[0]])
def follow_grad(starting_point, f, lims=[0, 1], eps=1e-2):
grad = autograd.grad(f)
points = [starting_point]
point = points[-1]
while (max(po... | 24.159091 | 66 | 0.66604 | from itertools import product
import autograd
import autograd.numpy as np
def orthogonalize(twovector):
return np.asarray([-twovector[1], twovector[0]])
def follow_grad(starting_point, f, lims=[0, 1], eps=1e-2):
grad = autograd.grad(f)
points = [starting_point]
point = points[-1]
while (max(po... | true | true |
1c3321d53937d70c3138dce8331d00032cd770e2 | 569 | py | Python | ex4.py | Tobijoe/LPTHW | 12f3e412c339f51828c909a94fd55ef6e7eb8b5b | [
"MIT"
] | null | null | null | ex4.py | Tobijoe/LPTHW | 12f3e412c339f51828c909a94fd55ef6e7eb8b5b | [
"MIT"
] | null | null | null | ex4.py | Tobijoe/LPTHW | 12f3e412c339f51828c909a94fd55ef6e7eb8b5b | [
"MIT"
] | null | null | null | cars = 100
space_in_a_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven
print ("There are", cars, "cars available.")
print ("There are only", drivers, "drivers available.")... | 37.933333 | 73 | 0.752197 | cars = 100
space_in_a_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven
print ("There are", cars, "cars available.")
print ("There are only", drivers, "drivers available.")... | true | true |
1c3321f2fce232ea67552cbefce40cb955c25c68 | 5,869 | py | Python | conclave/__init__.py | byzhang/conclave | ddc6a39df2c577d1f3cd2c969d67a7760f4b596f | [
"MIT"
] | 69 | 2018-02-28T13:25:24.000Z | 2022-03-17T00:51:43.000Z | conclave/__init__.py | byzhang/conclave | ddc6a39df2c577d1f3cd2c969d67a7760f4b596f | [
"MIT"
] | 5 | 2018-01-29T16:57:19.000Z | 2020-06-15T15:06:57.000Z | conclave/__init__.py | byzhang/conclave | ddc6a39df2c577d1f3cd2c969d67a7760f4b596f | [
"MIT"
] | 25 | 2018-01-23T22:09:11.000Z | 2022-01-16T11:26:44.000Z | import conclave.comp as comp
import conclave.dag as condag
import conclave.partition as part
from conclave.codegen import scotch
from conclave.codegen.python import PythonCodeGen
from conclave.codegen.sharemind import SharemindCodeGen
from conclave.codegen.spark import SparkCodeGen
from conclave.codegen.oblivc import O... | 41.041958 | 114 | 0.671324 | import conclave.comp as comp
import conclave.dag as condag
import conclave.partition as part
from conclave.codegen import scotch
from conclave.codegen.python import PythonCodeGen
from conclave.codegen.sharemind import SharemindCodeGen
from conclave.codegen.spark import SparkCodeGen
from conclave.codegen.oblivc import O... | true | true |
1c332227a6194c8234094026d9cfbccdd8d11330 | 570 | py | Python | benchmark/test_ope.py | MartinHeinz/IoT-Cloud | 2e6fddcfe2624862c9351759334a6655a896e8c7 | [
"MIT"
] | 14 | 2019-11-17T23:49:20.000Z | 2022-02-04T23:28:45.000Z | benchmark/test_ope.py | MartinHeinz/IoT-Cloud | 2e6fddcfe2624862c9351759334a6655a896e8c7 | [
"MIT"
] | 3 | 2019-12-02T18:26:11.000Z | 2021-04-30T20:46:06.000Z | benchmark/test_ope.py | MartinHeinz/IoT-Cloud | 2e6fddcfe2624862c9351759334a6655a896e8c7 | [
"MIT"
] | 4 | 2018-12-28T13:41:44.000Z | 2020-09-13T14:14:06.000Z | from random import randint
import pytest
from pyope.ope import OPE
from client.crypto_utils import instantiate_ope_cipher
@pytest.fixture(scope="module", autouse=True)
def cipher():
random_key = OPE.generate_key()
c = instantiate_ope_cipher(random_key)
return c
def test_ope_encrypt(benchmark, cipher):... | 25.909091 | 110 | 0.764912 | from random import randint
import pytest
from pyope.ope import OPE
from client.crypto_utils import instantiate_ope_cipher
@pytest.fixture(scope="module", autouse=True)
def cipher():
random_key = OPE.generate_key()
c = instantiate_ope_cipher(random_key)
return c
def test_ope_encrypt(benchmark, cipher):... | true | true |
1c3322701550af76c8751e686cfd254af5a7c22f | 34,040 | py | Python | packages/fetchai/protocols/tac/message.py | devjsc/agents-aea | 872f7b76cbcd33b6c809905c68681790bb93ff2f | [
"Apache-2.0"
] | null | null | null | packages/fetchai/protocols/tac/message.py | devjsc/agents-aea | 872f7b76cbcd33b6c809905c68681790bb93ff2f | [
"Apache-2.0"
] | null | null | null | packages/fetchai/protocols/tac/message.py | devjsc/agents-aea | 872f7b76cbcd33b6c809905c68681790bb93ff2f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021 fetchai
#
# 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
#
#... | 44.150454 | 143 | 0.503613 |
import logging
from typing import Any, Dict, Optional, Set, Tuple, cast
from aea.configurations.base import PublicId
from aea.exceptions import AEAEnforceError, enforce
from aea.protocols.base import Message
from packages.fetchai.protocols.tac.custom_types import ErrorCode as CustomErrorCode
_de... | true | true |
1c3323146779e0cbb445f721075cc2454146f5ce | 13,377 | py | Python | sdk/python/pulumi_azure_native/datashare/synapse_workspace_sql_pool_table_data_set.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datashare/synapse_workspace_sql_pool_table_data_set.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datashare/synapse_workspace_sql_pool_table_data_set.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 46.936842 | 1,089 | 0.676684 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
__all__ = ['SynapseWorkspaceSqlPoolTableDataSetArgs', 'SynapseWorkspaceSqlPoolTableDataSet']
@pulumi.input_type
class SynapseWorkspaceSqlPoolTabl... | true | true |
1c33247d1ebd76b37c331b06ae4b8b207ceb0b05 | 16,856 | py | Python | dbtmetabase/metabase.py | venturehacks/dbt-metabase | 8fd76c5b2dab180fca24b6742b68f5f668a3e7cb | [
"MIT"
] | null | null | null | dbtmetabase/metabase.py | venturehacks/dbt-metabase | 8fd76c5b2dab180fca24b6742b68f5f668a3e7cb | [
"MIT"
] | null | null | null | dbtmetabase/metabase.py | venturehacks/dbt-metabase | 8fd76c5b2dab180fca24b6742b68f5f668a3e7cb | [
"MIT"
] | null | null | null | import json
import logging
from typing import Any, Sequence, Optional, Tuple, Iterable, MutableMapping, Union
import requests
import time
from .models.metabase import MetabaseModel, MetabaseColumn
class MetabaseClient:
"""Metabase API client."""
_SYNC_PERIOD_SECS = 5
def __init__(
self,
... | 35.116667 | 149 | 0.54669 | import json
import logging
from typing import Any, Sequence, Optional, Tuple, Iterable, MutableMapping, Union
import requests
import time
from .models.metabase import MetabaseModel, MetabaseColumn
class MetabaseClient:
_SYNC_PERIOD_SECS = 5
def __init__(
self,
host: str,
user: str,... | true | true |
1c33255da650a6e219e2d8259c06989b5ad06956 | 2,091 | py | Python | hknweb/urls.py | yousefh409/hknweb | d791e9f009d216a6e61f5a62a71077ff1098d9e7 | [
"MIT"
] | 1 | 2021-11-03T04:42:09.000Z | 2021-11-03T04:42:09.000Z | hknweb/urls.py | yousefh409/hknweb | d791e9f009d216a6e61f5a62a71077ff1098d9e7 | [
"MIT"
] | null | null | null | hknweb/urls.py | yousefh409/hknweb | d791e9f009d216a6e61f5a62a71077ff1098d9e7 | [
"MIT"
] | null | null | null | """hknweb URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/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-base... | 41.82 | 80 | 0.702056 | from django.contrib import admin
from django.urls import include
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from .shortlinks import views as viewsShortlink
from .views import landing
from .views import users
urlpatterns = [
path("admin/", admin.site.ur... | true | true |
1c332573b838a8eb88b2d6b5b813b8b4fa3e8fc9 | 342 | py | Python | autotest/tests/login/conftest.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | autotest/tests/login/conftest.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | autotest/tests/login/conftest.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
"""
@version: v1.0
@author: Richard
@license: Apache Licence
@contact: billions.richard@qq.com
@site:https://github.com/BillionsRichard
@software: PyCharm
@time: 2020/11/1 10:53
"""
import pytest
@pytest.fixture(scope="package", autouse=True)
def st_login():
print("初始化---login")
yield
... | 14.869565 | 46 | 0.684211 |
import pytest
@pytest.fixture(scope="package", autouse=True)
def st_login():
print("初始化---login")
yield
print("清除---login")
| true | true |
1c3325c5abfa60aab2337e73ceec6e344c0c323f | 3,960 | py | Python | test/programytest/storage/stores/nosql/redis/store/test_conversations.py | cdoebler1/AIML2 | ee692ec5ea3794cd1bc4cc8ec2a6b5e5c20a0d6a | [
"MIT"
] | 345 | 2016-11-23T22:37:04.000Z | 2022-03-30T20:44:44.000Z | test/programytest/storage/stores/nosql/redis/store/test_conversations.py | MikeyBeez/program-y | 00d7a0c7d50062f18f0ab6f4a041068e119ef7f0 | [
"MIT"
] | 275 | 2016-12-07T10:30:28.000Z | 2022-02-08T21:28:33.000Z | test/programytest/storage/stores/nosql/redis/store/test_conversations.py | VProgramMist/modified-program-y | f32efcafafd773683b3fe30054d5485fe9002b7d | [
"MIT"
] | 159 | 2016-11-28T18:59:30.000Z | 2022-03-20T18:02:44.000Z | import unittest
import programytest.storage.engines as Engines
from programy.dialog.conversation import Conversation
from programy.dialog.question import Question
from programy.storage.stores.nosql.redis.config import RedisStorageConfiguration
from programy.storage.stores.nosql.redis.engine import RedisStorageEngine
f... | 39.6 | 91 | 0.736869 | import unittest
import programytest.storage.engines as Engines
from programy.dialog.conversation import Conversation
from programy.dialog.question import Question
from programy.storage.stores.nosql.redis.config import RedisStorageConfiguration
from programy.storage.stores.nosql.redis.engine import RedisStorageEngine
f... | true | true |
1c3326aed05c037d41918d057a1a93994e862c35 | 1,971 | py | Python | consoleerp_erpnext_client/api/custom_link_queries.py | consoleerp/consoleerp_erpnext_client | 44bc79f45e87c750e739d4cc82a42ecd7b94eb60 | [
"MIT"
] | 3 | 2017-04-02T11:44:01.000Z | 2018-05-04T20:46:19.000Z | consoleerp_erpnext_client/api/custom_link_queries.py | consoleerp/consoleerp_erpnext_client | 44bc79f45e87c750e739d4cc82a42ecd7b94eb60 | [
"MIT"
] | 7 | 2017-03-25T08:31:34.000Z | 2017-05-18T09:48:50.000Z | consoleerp_erpnext_client/api/custom_link_queries.py | consoleerp/consoleerp_erpnext_client | 44bc79f45e87c750e739d4cc82a42ecd7b94eb60 | [
"MIT"
] | 4 | 2017-04-02T11:44:02.000Z | 2019-08-29T17:08:49.000Z | from __future__ import unicode_literals
import frappe
from frappe.desk.reportview import get_match_cond
from frappe.model.db_query import DatabaseQuery
from frappe.utils import nowdate
def customer_query(doctype, txt, searchfield, start, page_len, filters):
conditions = []
cust_master_name = frappe.defaults.get_use... | 29.41791 | 79 | 0.666667 | from __future__ import unicode_literals
import frappe
from frappe.desk.reportview import get_match_cond
from frappe.model.db_query import DatabaseQuery
from frappe.utils import nowdate
def customer_query(doctype, txt, searchfield, start, page_len, filters):
conditions = []
cust_master_name = frappe.defaults.get_use... | true | true |
1c33272368020e92f0b9071c611e84c90714f5f1 | 976 | py | Python | MAQTextSDK/models/data_input_data_item_py3.py | maqsoftware/TextAnalyticsSDK | 545533d79db2f23e395495e9968c121ea3474ae4 | [
"MIT"
] | null | null | null | MAQTextSDK/models/data_input_data_item_py3.py | maqsoftware/TextAnalyticsSDK | 545533d79db2f23e395495e9968c121ea3474ae4 | [
"MIT"
] | null | null | null | MAQTextSDK/models/data_input_data_item_py3.py | maqsoftware/TextAnalyticsSDK | 545533d79db2f23e395495e9968c121ea3474ae4 | [
"MIT"
] | 6 | 2020-11-19T07:09:54.000Z | 2021-12-06T10:40:14.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 27.111111 | 76 | 0.505123 |
from msrest.serialization import Model
class DataInputDataItem(Model):
_validation = {
"id": {"required": True},
"text": {"required": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"text": {"key": "text", "type": "str"},
}
def __init__(sel... | true | true |
1c3327f3a2fa39f13359dcded445dadbcae279bc | 8,736 | py | Python | detectron/modeling/backbone/ftt_fpn.py | guowenhao787938711/EFPN-detectron2 | 58caabcf5edd5615f17d844618cf42367e567ee3 | [
"Apache-2.0"
] | 1 | 2021-07-16T06:05:56.000Z | 2021-07-16T06:05:56.000Z | detectron2/modeling/backbone/ftt_fpn.py | Kg6815311/pipe_EFPN_detectron2 | 1a381027cc19845afb88461bd5c96fa0fd75f449 | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/backbone/ftt_fpn.py | Kg6815311/pipe_EFPN_detectron2 | 1a381027cc19845afb88461bd5c96fa0fd75f449 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
import math
import fvcore.nn.weight_init as weight_init
import torch.nn.functional as F
from torch import nn
from detectron2.layers import Conv2d, ShapeSpec, get_norm
from .backbone import Backbone
from .build import BACKBONE_REGISTRY
from .resnet import build_resnet... | 39.529412 | 99 | 0.616529 |
import math
import fvcore.nn.weight_init as weight_init
import torch.nn.functional as F
from torch import nn
from detectron2.layers import Conv2d, ShapeSpec, get_norm
from .backbone import Backbone
from .build import BACKBONE_REGISTRY
from .resnet import build_resnet_backbone
from .ftt import FTT
__all__ = ["build... | true | true |
1c332877e8cbf590e4cefbf6c34341c2dc3f327f | 1,281 | py | Python | models/work_concept.py | zbj-labs/openalex-guts | 4e54363591da66b35a7376009ad1bca534559f98 | [
"MIT"
] | null | null | null | models/work_concept.py | zbj-labs/openalex-guts | 4e54363591da66b35a7376009ad1bca534559f98 | [
"MIT"
] | null | null | null | models/work_concept.py | zbj-labs/openalex-guts | 4e54363591da66b35a7376009ad1bca534559f98 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from app import db
# truncate mid.work_concept
# insert into mid.work_concept (select * from legacy.mag_advanced_paper_fields_of_study)
# refresh materialized view mid.work_concept_for_api_mv
class WorkConcept(db.Model):
__table_args__ = {'schema': 'mid'}
__tablen... | 35.583333 | 122 | 0.736144 | from cached_property import cached_property
from app import db
class WorkConcept(db.Model):
__table_args__ = {'schema': 'mid'}
__tablename__ = "work_concept_for_api_mv"
paper_id = db.Column(db.BigInteger, db.ForeignKey("mid.work.paper_id"), primary_key=True)
field_of_study = db.Column(db.BigInte... | true | true |
1c332a2579cdb6149a4ddf3406958e98917add97 | 174 | py | Python | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_ConstantTrend_Seasonal_MonthOfYear_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_ConstantTrend_Seasonal_MonthOfYear_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_ConstantTrend_Seasonal_MonthOfYear_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['ConstantTrend'] , ['Seasonal_MonthOfYear'] , ['SVR'] ); | 43.5 | 96 | 0.770115 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['ConstantTrend'] , ['Seasonal_MonthOfYear'] , ['SVR'] ); | true | true |
1c332adf25a96537958b311ef5dcb734e23f444c | 1,047 | py | Python | seq2seq/metrics/test.py | gyy8426/TF_concaption | 7b3face47c96c885b2715605122328b7b6bef609 | [
"Apache-2.0"
] | null | null | null | seq2seq/metrics/test.py | gyy8426/TF_concaption | 7b3face47c96c885b2715605122328b7b6bef609 | [
"Apache-2.0"
] | null | null | null | seq2seq/metrics/test.py | gyy8426/TF_concaption | 7b3face47c96c885b2715605122328b7b6bef609 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from tensorflow.contrib import metrics
from tensorflow.contrib.learn import MetricSpec
def accumulate_strings(values, name="strings"):
"""Accumulates strings into a vector.
Args:
values: A 1-d string tensor that contains values to add to the accumulator.
Returns:
A tu... | 27.552632 | 80 | 0.674308 | import tensorflow as tf
from tensorflow.contrib import metrics
from tensorflow.contrib.learn import MetricSpec
def accumulate_strings(values, name="strings"):
tf.assert_type(values, tf.string)
strings = tf.Variable(
name=name,
initial_value=[],
dtype=tf.string,
trainable=False,
... | true | true |
1c332b281ac35c1405ffb25ee199f2a15ddae1dc | 1,261 | py | Python | python/lib/dcoscli/tests/integrations/test_auth.py | bamarni/dcos-core-cli | a550652477175f48708a361fd0d65e21d243cded | [
"Apache-2.0",
"MIT"
] | null | null | null | python/lib/dcoscli/tests/integrations/test_auth.py | bamarni/dcos-core-cli | a550652477175f48708a361fd0d65e21d243cded | [
"Apache-2.0",
"MIT"
] | null | null | null | python/lib/dcoscli/tests/integrations/test_auth.py | bamarni/dcos-core-cli | a550652477175f48708a361fd0d65e21d243cded | [
"Apache-2.0",
"MIT"
] | null | null | null | import os
import pytest
from dcos import constants
from dcoscli.test.common import assert_command, exec_command, update_config
@pytest.fixture
def env():
r = os.environ.copy()
r.update({constants.PATH_ENV: os.environ[constants.PATH_ENV]})
return r
def test_info():
stdout = b'Authenticate to DC/O... | 26.270833 | 75 | 0.620936 | import os
import pytest
from dcos import constants
from dcoscli.test.common import assert_command, exec_command, update_config
@pytest.fixture
def env():
r = os.environ.copy()
r.update({constants.PATH_ENV: os.environ[constants.PATH_ENV]})
return r
def test_info():
stdout = b'Authenticate to DC/O... | true | true |
1c332b4a13f5fefc7873b7b77a62dad93a489440 | 2,703 | py | Python | apps/sumo/monkeypatch.py | taliasman/kitsune | f8085205eef143011adb4c52d1f183da06c1c58e | [
"BSD-3-Clause"
] | 2 | 2019-08-19T17:08:47.000Z | 2019-10-05T11:37:02.000Z | apps/sumo/monkeypatch.py | taliasman/kitsune | f8085205eef143011adb4c52d1f183da06c1c58e | [
"BSD-3-Clause"
] | null | null | null | apps/sumo/monkeypatch.py | taliasman/kitsune | f8085205eef143011adb4c52d1f183da06c1c58e | [
"BSD-3-Clause"
] | null | null | null | from django.forms import fields
from django.forms import widgets
# Monkey patch preserves the old values, so we can pick up any changes
# in CharField.widget_attrs and Field.widget_attrs
# paulc filed a Django ticket for it, #14884
field_widget_attrs = fields.Field.widget_attrs
charfield_widget_attrs = fields.CharFiel... | 31.8 | 79 | 0.740659 | from django.forms import fields
from django.forms import widgets
_widget_attrs = fields.Field.widget_attrs
charfield_widget_attrs = fields.CharField.widget_attrs
def required_field_attrs(self, widget):
attrs = field_widget_attrs(self, widget)
if (self.required and (not 'required' in attrs) and
... | true | true |
1c332bb22561fec9d19d2aa8adf27d639e17a682 | 2,277 | py | Python | tests/test_structures.py | davidfischer/requests | 7a404cf4ec5aac04d72dc507a981fee944b18cd8 | [
"Apache-2.0"
] | 10 | 2016-08-03T05:10:16.000Z | 2018-04-10T19:36:35.000Z | tests/test_structures.py | davidfischer/requests | 7a404cf4ec5aac04d72dc507a981fee944b18cd8 | [
"Apache-2.0"
] | 25 | 2016-08-24T00:19:19.000Z | 2021-04-17T14:20:24.000Z | tests/test_structures.py | davidfischer/requests | 7a404cf4ec5aac04d72dc507a981fee944b18cd8 | [
"Apache-2.0"
] | 2 | 2019-06-17T11:51:56.000Z | 2020-07-25T08:29:56.000Z | # coding: utf-8
import pytest
from requests.structures import CaseInsensitiveDict, LookupDict
class TestCaseInsensitiveDict:
@pytest.fixture(autouse=True)
def setup(self):
"""
CaseInsensitiveDict instance with "Accept" header.
"""
self.case_insensitive_dict = CaseInsensitiveD... | 28.4625 | 97 | 0.63856 |
import pytest
from requests.structures import CaseInsensitiveDict, LookupDict
class TestCaseInsensitiveDict:
@pytest.fixture(autouse=True)
def setup(self):
self.case_insensitive_dict = CaseInsensitiveDict()
self.case_insensitive_dict['Accept'] = 'application/json'
def test_list(self):
... | true | true |
1c332bd5f1d5fd836763369f4e2ded2d5830f275 | 7,504 | py | Python | CSM_Cleanup.py | LGTOman/CSM_Cleanup | a28445c98213a39735c929825aff7a1a966f05b6 | [
"MIT"
] | null | null | null | CSM_Cleanup.py | LGTOman/CSM_Cleanup | a28445c98213a39735c929825aff7a1a966f05b6 | [
"MIT"
] | null | null | null | CSM_Cleanup.py | LGTOman/CSM_Cleanup | a28445c98213a39735c929825aff7a1a966f05b6 | [
"MIT"
] | null | null | null | import sys
import boto3
from botocore.exceptions import ClientError, EndpointConnectionError
from datetime import datetime, timedelta, timezone
import argparse
import pprint
product = "Dell EMC Cloud Snapshot Manager (aka Amazonite)"
defaultdays = 60
dryrun = False
regions = []
parser = argparse.ArgumentParser(descr... | 34.902326 | 141 | 0.604211 | import sys
import boto3
from botocore.exceptions import ClientError, EndpointConnectionError
from datetime import datetime, timedelta, timezone
import argparse
import pprint
product = "Dell EMC Cloud Snapshot Manager (aka Amazonite)"
defaultdays = 60
dryrun = False
regions = []
parser = argparse.ArgumentParser(descr... | true | true |
1c332bf5fc4caea777c8a2827663952f8a4ac75d | 3,438 | py | Python | network/sdn/l2_pairs.py | sabertazimi/hust-lab | dc3425b6afe75ac3c1b48bb62fdd27c425284a0f | [
"MIT"
] | 29 | 2017-07-30T07:46:11.000Z | 2021-11-21T15:51:04.000Z | network/sdn/l2_pairs.py | sabertazimi/hust-lab | dc3425b6afe75ac3c1b48bb62fdd27c425284a0f | [
"MIT"
] | 2 | 2018-03-22T10:09:35.000Z | 2021-09-12T16:08:35.000Z | network/sdn/l2_pairs.py | sabertazimi/hust-lab | dc3425b6afe75ac3c1b48bb62fdd27c425284a0f | [
"MIT"
] | 9 | 2018-09-03T13:14:08.000Z | 2021-06-25T17:00:46.000Z | # Copyright 2012 James McCauley
#
# 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 writi... | 34.38 | 152 | 0.717859 |
from pox.core import core
import pox.openflow.libopenflow_01 as of
from pox.lib.util import dpid_to_str, str_to_dpid
log = core.getLogger()
table = {}
# but it's not clear if all switches support this, so we make
all_ports = of.OFPP_FLOOD
def _handle_PacketIn (event):
packet = event... | true | true |
1c332c87eea00365557e19e91322e96fdb2d1137 | 3,378 | py | Python | day_24/part_1/main.py | MoeFourtyTwo/advent-of-code | 123a716a26add390913eb268a59ef68b45666ef4 | [
"MIT"
] | null | null | null | day_24/part_1/main.py | MoeFourtyTwo/advent-of-code | 123a716a26add390913eb268a59ef68b45666ef4 | [
"MIT"
] | null | null | null | day_24/part_1/main.py | MoeFourtyTwo/advent-of-code | 123a716a26add390913eb268a59ef68b45666ef4 | [
"MIT"
] | null | null | null | from __future__ import annotations
import timeit
import fire
import pandas as pd
from tqdm import tqdm
def main(input_file: str = "input.txt", search_max: bool = True) -> None:
instructions = parse_instructions(input_file)
alus = pd.DataFrame(
{
"w": [0],
"x": 0,
... | 35.1875 | 94 | 0.530491 | from __future__ import annotations
import timeit
import fire
import pandas as pd
from tqdm import tqdm
def main(input_file: str = "input.txt", search_max: bool = True) -> None:
instructions = parse_instructions(input_file)
alus = pd.DataFrame(
{
"w": [0],
"x": 0,
... | true | true |
1c332c9df7e7b1bcd442640eb38fe7704e22ec65 | 10,076 | py | Python | classifier/train.py | shivammehta007/NLPinEnglishLearning | ae869d868e39df9b1787134ba6e964acd385dd2e | [
"Apache-2.0"
] | 1 | 2020-05-27T22:21:33.000Z | 2020-05-27T22:21:33.000Z | classifier/train.py | shivammehta007/NLPinEnglishLearning | ae869d868e39df9b1787134ba6e964acd385dd2e | [
"Apache-2.0"
] | null | null | null | classifier/train.py | shivammehta007/NLPinEnglishLearning | ae869d868e39df9b1787134ba6e964acd385dd2e | [
"Apache-2.0"
] | null | null | null | """
Training script for the model
"""
import argparse
import logging
import os
import time
import torch
import torch.nn as nn
import torch.optim as optim
from tqdm.auto import tqdm
from config.hyperparameters import (
BATCH_SIZE,
BIDIRECTION,
DROPOUT,
EMBEDDING_DIM,
EPOCHS,
FREEZE_EMBEDDINGS,
... | 26.308094 | 98 | 0.599047 | import argparse
import logging
import os
import time
import torch
import torch.nn as nn
import torch.optim as optim
from tqdm.auto import tqdm
from config.hyperparameters import (
BATCH_SIZE,
BIDIRECTION,
DROPOUT,
EMBEDDING_DIM,
EPOCHS,
FREEZE_EMBEDDINGS,
HIDDEN_DIM,
LR,
N_LAYERS,
... | true | true |
1c332df2de45291065787fb30c0fb88048124ea9 | 1,161 | py | Python | ros2trace/setup.py | hliberacki/ros2_tracing | c0a3512137382bd97c5a013526d3d4f59f58c165 | [
"Apache-2.0"
] | null | null | null | ros2trace/setup.py | hliberacki/ros2_tracing | c0a3512137382bd97c5a013526d3d4f59f58c165 | [
"Apache-2.0"
] | null | null | null | ros2trace/setup.py | hliberacki/ros2_tracing | c0a3512137382bd97c5a013526d3d4f59f58c165 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages
from setuptools import setup
package_name = 'ros2trace'
setup(
name=package_name,
version='4.0.0',
packages=find_packages(exclude=['test']),
data_files=[
('share/' + package_name, ['package.xml']),
('share/ament_index/resource_index/packages',
... | 27.642857 | 68 | 0.625323 | from setuptools import find_packages
from setuptools import setup
package_name = 'ros2trace'
setup(
name=package_name,
version='4.0.0',
packages=find_packages(exclude=['test']),
data_files=[
('share/' + package_name, ['package.xml']),
('share/ament_index/resource_index/packages',
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.