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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c189e24495ee0eb710ff546aaa30441b243197f | 1,987 | py | Python | dber/tests/dber_tester.py | kancyframework/python-plugins | 430d0f781b5669d8e6ad83f7af0782b672c43db5 | [
"MIT"
] | 1 | 2021-12-11T12:44:12.000Z | 2021-12-11T12:44:12.000Z | dber/tests/dber_tester.py | kancyframework/python-plugins | 430d0f781b5669d8e6ad83f7af0782b672c43db5 | [
"MIT"
] | null | null | null | dber/tests/dber_tester.py | kancyframework/python-plugins | 430d0f781b5669d8e6ad83f7af0782b672c43db5 | [
"MIT"
] | null | null | null | import os
from dber.dber import MySQL
from dber.dber import SQLite
database = "test.db"
rows = []
for i in range(0, 100):
rows.append((f"k{i}", f"v{i}"))
db = SQLite(database, debug=True)
# db = MySQL(password="root", database="test", debug=True)
db.execute("CREATE TABLE IF NOT EXISTS t_test (data_key varchar(25... | 50.948718 | 117 | 0.710116 | import os
from dber.dber import MySQL
from dber.dber import SQLite
database = "test.db"
rows = []
for i in range(0, 100):
rows.append((f"k{i}", f"v{i}"))
db = SQLite(database, debug=True)
db.execute("CREATE TABLE IF NOT EXISTS t_test (data_key varchar(255) PRIMARY KEY, data_value text);")
print(db.getTableNames(... | true | true |
1c18a050e4a671f28f364e9c9bad58a30d89628f | 1,105 | py | Python | test/test_split_text_document_by_string_result.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | dba2fe7257229ebdacd266531b3724552c651009 | [
"Apache-2.0"
] | 3 | 2018-07-25T23:04:34.000Z | 2021-08-10T16:43:10.000Z | test/test_split_text_document_by_string_result.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | dba2fe7257229ebdacd266531b3724552c651009 | [
"Apache-2.0"
] | 3 | 2020-11-23T10:46:48.000Z | 2021-12-30T14:09:34.000Z | test/test_split_text_document_by_string_result.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | dba2fe7257229ebdacd266531b3724552c651009 | [
"Apache-2.0"
] | 2 | 2020-01-07T09:48:01.000Z | 2020-11-23T10:47:00.000Z | # coding: utf-8
"""
convertapi
Convert API lets you effortlessly convert file formats and types. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import cloudmersive_convert_api_... | 26.95122 | 141 | 0.762896 |
from __future__ import absolute_import
import unittest
import cloudmersive_convert_api_client
from cloudmersive_convert_api_client.models.split_text_document_by_string_result import SplitTextDocumentByStringResult from cloudmersive_convert_api_client.rest import ApiException
class TestSplitTextDocumentByStringR... | true | true |
1c18a27c0d76a4e11f473c0e042a4e198c8bdd58 | 14,929 | py | Python | apps/utils/handler.py | Freen247/dj_blog | f7df1a7b101d41835a334b78cddf3570968799e4 | [
"Apache-2.0"
] | 51 | 2020-09-28T09:41:03.000Z | 2022-03-19T08:25:19.000Z | apps/utils/handler.py | Freen247/dj_blog | f7df1a7b101d41835a334b78cddf3570968799e4 | [
"Apache-2.0"
] | 17 | 2020-09-24T10:26:40.000Z | 2022-03-12T00:49:05.000Z | apps/utils/handler.py | Freen247/django_blogback | f7df1a7b101d41835a334b78cddf3570968799e4 | [
"Apache-2.0"
] | 11 | 2020-10-10T01:23:09.000Z | 2022-02-08T17:06:09.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# __author__ : stray_camel
# __date__: 2020/05/26 11:09:55
import io
import re
import socket
import platform
import requests
from openpyxl import Workbook
from openpyxl.comments import Comment
from openpyxl.styles import Alignment, Border, PatternFill, Side
from openpyxl.utils... | 39.599469 | 124 | 0.496148 |
import io
import re
import socket
import platform
import requests
from openpyxl import Workbook
from openpyxl.comments import Comment
from openpyxl.styles import Alignment, Border, PatternFill, Side
from openpyxl.utils import get_column_letter
def get_host_ip():
try:
s = socket.socket(socket.AF_INET, soc... | true | true |
1c18a2a3622a8a86191b4292d322ebf2920555d9 | 1,956 | py | Python | login_server.py | summer2233/File-Transfer | 2fda315df8f951c0d99154a661dfcf78ee4b015e | [
"MIT"
] | null | null | null | login_server.py | summer2233/File-Transfer | 2fda315df8f951c0d99154a661dfcf78ee4b015e | [
"MIT"
] | null | null | null | login_server.py | summer2233/File-Transfer | 2fda315df8f951c0d99154a661dfcf78ee4b015e | [
"MIT"
] | null | null | null | # This is the server code
import csv
import socket
import sys
import traceback
# filename of csv file-name
filename = 'login_credentials.csv'
data = {}
host = socket.gethostname()
# Function to validate authentication
def validate_login(username, password):
if (data.get(username)) is None:
return '0'
... | 25.402597 | 69 | 0.576687 | import csv
import socket
import sys
import traceback
filename = 'login_credentials.csv'
data = {}
host = socket.gethostname()
def validate_login(username, password):
if (data.get(username)) is None:
return '0'
elif (data[username] == password):
return '1'
else:
return '0'
def f... | true | true |
1c18a2fad160ceec7fc319e67c337dfaa45edbe3 | 2,533 | py | Python | utils/preprocessing.py | noahchalifour/memn2n | 0eb341c45c1259b5dbb041cfa264251dc7b9383c | [
"MIT"
] | 2 | 2021-04-12T08:44:30.000Z | 2021-05-27T01:24:50.000Z | utils/preprocessing.py | noahchalifour/memn2n | 0eb341c45c1259b5dbb041cfa264251dc7b9383c | [
"MIT"
] | null | null | null | utils/preprocessing.py | noahchalifour/memn2n | 0eb341c45c1259b5dbb041cfa264251dc7b9383c | [
"MIT"
] | 1 | 2020-04-27T07:56:58.000Z | 2020-04-27T07:56:58.000Z | import tensorflow as tf
# import tensorflow_text as tf_text
from .hparams import *
def get_tokenizer_fn(hparams):
# tf_word_tokenizer = tf_text.WhitespaceTokenizer()
def word_tokenize(text):
# return tf_word_tokenizer.tokenize(text)
return tf.strings.split(text, sep=' ')
def character_... | 27.236559 | 71 | 0.607185 | import tensorflow as tf
from .hparams import *
def get_tokenizer_fn(hparams):
def word_tokenize(text):
return tf.strings.split(text, sep=' ')
def character_tokenize(text):
return tf.strings.bytes_split(text)
if hparams[HP_TOKEN_TYPE.name] == 'word':
return word_tok... | true | true |
1c18a3481b58c0c7a621d63876a1dea178aa86e4 | 61 | py | Python | netbox/utilities/testing/__init__.py | esljaz/netbox | e7f64334c06748b4b85c54d881f5e2b03b9463b5 | [
"Apache-2.0"
] | 2 | 2021-06-02T03:00:05.000Z | 2021-07-30T18:52:32.000Z | netbox/utilities/testing/__init__.py | esljaz/netbox | e7f64334c06748b4b85c54d881f5e2b03b9463b5 | [
"Apache-2.0"
] | 25 | 2019-09-17T19:40:50.000Z | 2022-03-11T04:01:55.000Z | netbox/utilities/testing/__init__.py | esljaz/netbox | e7f64334c06748b4b85c54d881f5e2b03b9463b5 | [
"Apache-2.0"
] | 1 | 2022-02-11T21:50:58.000Z | 2022-02-11T21:50:58.000Z | from .api import *
from .utils import *
from .views import *
| 15.25 | 20 | 0.704918 | from .api import *
from .utils import *
from .views import *
| true | true |
1c18a353ff2f57dbfa402f824c844330fef2ec59 | 435 | py | Python | filter_plugins/map_format.py | HarrisChu/nebula-ansible | 919c0a421cf82a46c322a92c3229091a265c4f79 | [
"Apache-2.0"
] | 5 | 2021-05-14T06:00:11.000Z | 2021-11-03T08:59:44.000Z | filter_plugins/map_format.py | HarrisChu/nebula-ansible | 919c0a421cf82a46c322a92c3229091a265c4f79 | [
"Apache-2.0"
] | 2 | 2021-05-17T06:03:25.000Z | 2021-08-16T08:02:42.000Z | filter_plugins/map_format.py | HarrisChu/nebula-ansible | 919c0a421cf82a46c322a92c3229091a265c4f79 | [
"Apache-2.0"
] | 2 | 2021-05-14T02:47:32.000Z | 2021-11-03T08:59:47.000Z | # -*- encoding: utf-8 -*-
try:
from jinja2.utils import soft_unicode
except:
from markupsafe import soft_unicode
def map_format(value, pattern):
"""
e.g.
"{{ groups['metad']|map('map_format', '%s:9559')|join(',') }}"
"""
return soft_unicode(pattern) % (value)
class FilterModule(object):... | 18.125 | 66 | 0.57931 |
try:
from jinja2.utils import soft_unicode
except:
from markupsafe import soft_unicode
def map_format(value, pattern):
return soft_unicode(pattern) % (value)
class FilterModule(object):
def filters(self):
return {
'map_format': map_format,
}
| true | true |
1c18a3b19892d54075e192323d3a12c6bbd44023 | 3,634 | py | Python | open_seq2seq/parts/convs2s/conv_wn_layer.py | Kipok/OpenSeq2Seq | cb48d2552e157c88f005c2a7364548a658e4cdf1 | [
"MIT"
] | null | null | null | open_seq2seq/parts/convs2s/conv_wn_layer.py | Kipok/OpenSeq2Seq | cb48d2552e157c88f005c2a7364548a658e4cdf1 | [
"MIT"
] | null | null | null | open_seq2seq/parts/convs2s/conv_wn_layer.py | Kipok/OpenSeq2Seq | cb48d2552e157c88f005c2a7364548a658e4cdf1 | [
"MIT"
] | null | null | null | """Implementation of a 1d convolutional layer with weight normalization.
Inspired from https://github.com/tobyyouup/conv_seq2seq"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import tensorflow as tf
import math
... | 34.942308 | 83 | 0.658503 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import tensorflow as tf
import math
class Conv1DNetworkNormalized(tf.layers.Layer):
def __init__(self, in_dim, out_dim, kernel_width, mode, layer_id,
... | true | true |
1c18a4330b0b97839ffcf2b09b7f944e9aedd38c | 7,451 | py | Python | schematizer/views/schemas.py | Yelp/schematizer | 035845d27945a05db475f00eb76f59e8825dbaa4 | [
"Apache-2.0"
] | 86 | 2016-11-17T17:39:13.000Z | 2021-06-01T15:19:05.000Z | schematizer/views/schemas.py | tomzhang/schematizer | 035845d27945a05db475f00eb76f59e8825dbaa4 | [
"Apache-2.0"
] | 2 | 2016-12-01T20:57:43.000Z | 2021-09-28T09:26:25.000Z | schematizer/views/schemas.py | tomzhang/schematizer | 035845d27945a05db475f00eb76f59e8825dbaa4 | [
"Apache-2.0"
] | 26 | 2016-11-29T22:38:11.000Z | 2021-03-02T19:44:17.000Z | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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 ag... | 33.263393 | 79 | 0.728895 | from __future__ import absolute_import
from __future__ import unicode_literals
import simplejson
from pyramid.view import view_config
from schematizer.api.decorators import log_api
from schematizer.api.decorators import transform_api_response
from schematizer.api.exceptions import exceptions_v1
from schematizer.api.r... | true | true |
1c18a58de0bd532f8523fd1267106cc31935e509 | 49,714 | py | Python | CodeSamples/Python 2.7/VEUtils/pika/channel.py | madridopenlabmobility/MOBILITY-MADRID-virtual-entities | d21ef28bc0e7d12567cf2bbb8ba55a49e39b6b45 | [
"Apache-2.0"
] | 1 | 2015-06-05T10:52:39.000Z | 2015-06-05T10:52:39.000Z | CodeSamples/Python 2.7/VEUtils/pika/channel.py | madridopenlabmobility/MOBILITY-MADRID-virtual-entities | d21ef28bc0e7d12567cf2bbb8ba55a49e39b6b45 | [
"Apache-2.0"
] | null | null | null | CodeSamples/Python 2.7/VEUtils/pika/channel.py | madridopenlabmobility/MOBILITY-MADRID-virtual-entities | d21ef28bc0e7d12567cf2bbb8ba55a49e39b6b45 | [
"Apache-2.0"
] | null | null | null | """The Channel class provides a wrapper for interacting with RabbitMQ
implementing the methods and behaviors for an AMQP Channel.
"""
import collections
import logging
import warnings
import uuid
import pika.frame as frame
import pika.exceptions as exceptions
import pika.spec as spec
from pika.utils import is_callabl... | 43.079723 | 80 | 0.618216 | import collections
import logging
import warnings
import uuid
import pika.frame as frame
import pika.exceptions as exceptions
import pika.spec as spec
from pika.utils import is_callable
LOGGER = logging.getLogger(__name__)
MAX_CHANNELS = 32768
class Channel(object):
CLOSED = 0
OPENING = 1
OPEN = 2
C... | true | true |
1c18a620e20f1fcc389fa3df607e23bf1cf5cf7e | 10,787 | py | Python | pcapkit/toolkit/scapy.py | chellvs/PyPCAPKit | f8d66f9955904196b71a6143e49ff4ec4c4922dc | [
"BSD-3-Clause"
] | 131 | 2018-10-12T09:45:44.000Z | 2022-03-31T18:58:14.000Z | pcapkit/toolkit/scapy.py | chellvs/PyPCAPKit | f8d66f9955904196b71a6143e49ff4ec4c4922dc | [
"BSD-3-Clause"
] | 39 | 2018-08-18T12:15:04.000Z | 2022-03-07T20:28:08.000Z | pcapkit/toolkit/scapy.py | chellvs/PyPCAPKit | f8d66f9955904196b71a6143e49ff4ec4c4922dc | [
"BSD-3-Clause"
] | 23 | 2018-10-12T09:45:52.000Z | 2022-03-05T15:23:00.000Z | # -*- coding: utf-8 -*-
"""Scapy tools
:mod:`pcapkit.toolkit.scapy` contains all you need for
:mod:`pcapkit` handy usage with `Scapy`_ engine. All reforming
functions returns with a flag to indicate if usable for
its caller.
.. _Scapy: https://scapy.net
Warns:
ScapyWarning: If `Scapy`_ is not installed.
"""
imp... | 39.368613 | 110 | 0.558357 | import ipaddress
import time
import warnings
from pcapkit.const.reg.linktype import LinkType as LINKTYPE
from pcapkit.const.reg.transtype import TransType as TP_PROTO
from pcapkit.utilities.exceptions import ModuleNotFound, stacklevel
from pcapkit.utilities.warnings import ScapyWarning
try:
import scapy.all as s... | true | true |
1c18a663db52b844a522fd07db8ab418b27c3ce4 | 3,584 | py | Python | phi/physics/pressuresolver/multiscale.py | VemburajYadav/PhiFlow | 842c113d1850569b97e30ab0632866bb5bc4b300 | [
"MIT"
] | null | null | null | phi/physics/pressuresolver/multiscale.py | VemburajYadav/PhiFlow | 842c113d1850569b97e30ab0632866bb5bc4b300 | [
"MIT"
] | null | null | null | phi/physics/pressuresolver/multiscale.py | VemburajYadav/PhiFlow | 842c113d1850569b97e30ab0632866bb5bc4b300 | [
"MIT"
] | 1 | 2021-05-04T16:31:41.000Z | 2021-05-04T16:31:41.000Z | import logging
import numpy as np
from phi import math
from .solver_api import PressureSolver, FluidDomain
class MultiscaleSolver(PressureSolver):
def __init__(self, solvers, autodiff=False):
"""
A multigrid solver first solves the pressure on a lower-resolution grid and successively upsamples a... | 48.432432 | 137 | 0.658482 | import logging
import numpy as np
from phi import math
from .solver_api import PressureSolver, FluidDomain
class MultiscaleSolver(PressureSolver):
def __init__(self, solvers, autodiff=False):
if isinstance(solvers, PressureSolver):
solvers = [solvers] * 2
PressureSolver.__init__(self... | true | true |
1c18a80c38127cbc2e9f6a01149d93563e55c76d | 2,217 | py | Python | tests/lib/test_util.py | lato333/zonefile-parser-1 | 663aadad9d7e4ddc92e47ae2a43dba04cf2db003 | [
"MIT"
] | null | null | null | tests/lib/test_util.py | lato333/zonefile-parser-1 | 663aadad9d7e4ddc92e47ae2a43dba04cf2db003 | [
"MIT"
] | null | null | null | tests/lib/test_util.py | lato333/zonefile-parser-1 | 663aadad9d7e4ddc92e47ae2a43dba04cf2db003 | [
"MIT"
] | null | null | null | import unittest
from zonefile_parser.helper import remove_comments
from zonefile_parser.helper import default_ttl
from zonefile_parser.helper import parse_bind
import zonefile_parser
from zonefile_parser.record import Record
class Util(unittest.TestCase):
def test_remove_comments(self):
test_string =... | 24.097826 | 67 | 0.623365 | import unittest
from zonefile_parser.helper import remove_comments
from zonefile_parser.helper import default_ttl
from zonefile_parser.helper import parse_bind
import zonefile_parser
from zonefile_parser.record import Record
class Util(unittest.TestCase):
def test_remove_comments(self):
test_string =... | true | true |
1c18a85c44910f0a3de0c9cce039824f9cec1203 | 752 | py | Python | y-2020/day-6.py | Vlad-Zumer/AdventOfCode | d03a9d05e6c9ac33f218c16beb11975fbb5f427a | [
"MIT"
] | 1 | 2022-01-25T13:50:35.000Z | 2022-01-25T13:50:35.000Z | y-2020/day-6.py | Vlad-Zumer/AdventOfCode | d03a9d05e6c9ac33f218c16beb11975fbb5f427a | [
"MIT"
] | null | null | null | y-2020/day-6.py | Vlad-Zumer/AdventOfCode | d03a9d05e6c9ac33f218c16beb11975fbb5f427a | [
"MIT"
] | null | null | null | import string
import functools as func
f = open("input.txt","r")
fileData = f.read()
f.close()
groups = fileData.split("\n\n")
questions = string.ascii_lowercase;
part = 2
if part == 1:
tot = 0
for group in groups:
group = group.replace("\n","")
ans = map(lambda x: 1 if x in group else 0, questions)
a... | 24.258065 | 88 | 0.585106 | import string
import functools as func
f = open("input.txt","r")
fileData = f.read()
f.close()
groups = fileData.split("\n\n")
questions = string.ascii_lowercase;
part = 2
if part == 1:
tot = 0
for group in groups:
group = group.replace("\n","")
ans = map(lambda x: 1 if x in group else 0, questions)
a... | true | true |
1c18a878d1a07dd5796fae573b2c231ab6919eee | 23,075 | py | Python | app/raw/migrations/0020_auto__chg_field_parsedquestion_replier.py | hupili/legco-watch | 06253a65d299564827972a38dc7d7dee5c1f6120 | [
"MIT"
] | null | null | null | app/raw/migrations/0020_auto__chg_field_parsedquestion_replier.py | hupili/legco-watch | 06253a65d299564827972a38dc7d7dee5c1f6120 | [
"MIT"
] | null | null | null | app/raw/migrations/0020_auto__chg_field_parsedquestion_replier.py | hupili/legco-watch | 06253a65d299564827972a38dc7d7dee5c1f6120 | [
"MIT"
] | 1 | 2020-05-24T17:08:57.000Z | 2020-05-24T17:08:57.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'ParsedQuestion.replier'
db.alter_column(u'raw_parsedqu... | 83.003597 | 204 | 0.552156 | from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.alter_column(u'raw_parsedquestion', 'replier', self.gf('django.db.models.fields.TextField')()... | true | true |
1c18a88e1e3f9319f406458652204a291f8cb921 | 2,740 | py | Python | mlrun/db/base.py | zilbermanor/mlrun | 243c3b4bea3bff168db9bd9764d4235675c2f886 | [
"Apache-2.0"
] | null | null | null | mlrun/db/base.py | zilbermanor/mlrun | 243c3b4bea3bff168db9bd9764d4235675c2f886 | [
"Apache-2.0"
] | null | null | null | mlrun/db/base.py | zilbermanor/mlrun | 243c3b4bea3bff168db9bd9764d4235675c2f886 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Iguazio
#
# 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, softwa... | 26.346154 | 79 | 0.639416 |
from abc import ABC, abstractmethod
import warnings
class RunDBError(Exception):
pass
class RunDBInterface(ABC):
kind = ''
@abstractmethod
def connect(self, secrets=None):
return self
@abstractmethod
def store_log(self, uid, project='', body=None, append=False):
pass
... | true | true |
1c18a8f0b9e1fa7eb88e65804b45ed67c03cf9e8 | 51 | py | Python | gpstardist/__init__.py | saalfeldlab/gunpowder-stardist | eb099c7a095d6f5adb0cb3e1626cbb2bd6bf260c | [
"BSD-2-Clause"
] | null | null | null | gpstardist/__init__.py | saalfeldlab/gunpowder-stardist | eb099c7a095d6f5adb0cb3e1626cbb2bd6bf260c | [
"BSD-2-Clause"
] | null | null | null | gpstardist/__init__.py | saalfeldlab/gunpowder-stardist | eb099c7a095d6f5adb0cb3e1626cbb2bd6bf260c | [
"BSD-2-Clause"
] | null | null | null | from .nodes import *
from .stardist_custom import * | 25.5 | 30 | 0.784314 | from .nodes import *
from .stardist_custom import * | true | true |
1c18a90e885b4aabfe2b9e6c6260ecdccc182a9e | 552 | py | Python | common_game_maths/Point.py | AlexanderFL/common-game-maths | 4b406436f6d718b2143452eb658f455a084d2e8b | [
"MIT"
] | null | null | null | common_game_maths/Point.py | AlexanderFL/common-game-maths | 4b406436f6d718b2143452eb658f455a084d2e8b | [
"MIT"
] | null | null | null | common_game_maths/Point.py | AlexanderFL/common-game-maths | 4b406436f6d718b2143452eb658f455a084d2e8b | [
"MIT"
] | null | null | null | from .Vector import Vector
# Class represents a single point in 3d space
class Point:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
# Add two points together
def __add__(self, other):
return Point(self.x + other.x, self.y + other.y, self.z + other.z)
# ... | 27.6 | 76 | 0.581522 | from .Vector import Vector
class Point:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
def __add__(self, other):
return Point(self.x + other.x, self.y + other.y, self.z + other.z)
def __sub__(self, other):
return Vector(self.x - other.x, self... | true | true |
1c18a9187213145e75b92e2a776b8f31654f5f45 | 821 | py | Python | mixedlayer.py | nfeldl/EBM-icy-moist-seasonal | 5837373438434c400ec5ac2b05e70e3ac32abe70 | [
"MIT"
] | 1 | 2021-09-03T00:26:31.000Z | 2021-09-03T00:26:31.000Z | mixedlayer.py | nfeldl/EBM-icy-moist-seasonal | 5837373438434c400ec5ac2b05e70e3ac32abe70 | [
"MIT"
] | null | null | null | mixedlayer.py | nfeldl/EBM-icy-moist-seasonal | 5837373438434c400ec5ac2b05e70e3ac32abe70 | [
"MIT"
] | 1 | 2021-06-23T15:53:33.000Z | 2021-06-23T15:53:33.000Z | #!/software/anaconda3/bin
cday = 86400.0 # sec in calendar day ~ sec
cyear = cday*365.25 # sec in calendar year ~ sec
cpsw = 3.996e3 # specific heat of sea water ~ J/kg/K
rhosw = 1.026e3 # density of sea water ~ kg/m^3
def heatcapacity(h):
"""
Calculate mixed-layer heat cap... | 18.659091 | 63 | 0.624848 |
cday = 86400.0 cyear = cday*365.25 cpsw = 3.996e3 rhosw = 1.026e3
def heatcapacity(h):
heat_capacity = cpsw*rhosw*h
heat_capacity = heat_capacity / cyear
return heat_capacity
def depth(C):
C = C * cyear
depth = C/(cpsw*rhosw)
return depth
def main():
p... | true | true |
1c18aa3bb837600a9ad6008fb013aa13e8a2d100 | 1,188 | py | Python | tests/test_utils.py | vektonn/vektonn-client-python | 61cd186cc207f4e9dd4651323186870c76b1d207 | [
"Apache-2.0"
] | 13 | 2021-11-22T06:41:37.000Z | 2021-12-07T08:23:23.000Z | tests/test_utils.py | vektonn/vektonn-client-python | 61cd186cc207f4e9dd4651323186870c76b1d207 | [
"Apache-2.0"
] | 2 | 2021-12-07T11:34:25.000Z | 2022-02-25T08:28:04.000Z | tests/test_utils.py | vektonn/vektonn-client-python | 61cd186cc207f4e9dd4651323186870c76b1d207 | [
"Apache-2.0"
] | null | null | null | import pytest
from vektonn.utils import camel_case_pydantic_alias_generator, prepare_request_headers
@pytest.mark.parametrize(
'input_string, expected_output',
[
('snake_case', 'snakeCase'),
('alreadyCamelCase', 'alreadyCamelCase'),
('PascalCase', 'PascalCase'),
('__root__', '... | 37.125 | 96 | 0.710438 | import pytest
from vektonn.utils import camel_case_pydantic_alias_generator, prepare_request_headers
@pytest.mark.parametrize(
'input_string, expected_output',
[
('snake_case', 'snakeCase'),
('alreadyCamelCase', 'alreadyCamelCase'),
('PascalCase', 'PascalCase'),
('__root__', '... | true | true |
1c18abc093d09e01510e9ce648c820a6171c8fda | 4,658 | py | Python | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/azure_vm_workload_sql_availability_group_protectable_item_py3.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/azure_vm_workload_sql_availability_group_protectable_item_py3.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/azure_vm_workload_sql_availability_group_protectable_item_py3.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 56.120482 | 530 | 0.718549 |
from .azure_vm_workload_protectable_item_py3 import AzureVmWorkloadProtectableItem
class AzureVmWorkloadSQLAvailabilityGroupProtectableItem(AzureVmWorkloadProtectableItem):
_validation = {
'protectable_item_type': {'required': True},
}
_attribute_map = {
'backup_management_type': {'key'... | true | true |
1c18abf83b3a65d18dc4e1c003daf02dee94c91d | 2,510 | py | Python | src/compas/com/rhino/client.py | gonzalocasas/compas | 2fabc7e5c966a02d823fa453564151e1a1e7e3c6 | [
"MIT"
] | null | null | null | src/compas/com/rhino/client.py | gonzalocasas/compas | 2fabc7e5c966a02d823fa453564151e1a1e7e3c6 | [
"MIT"
] | null | null | null | src/compas/com/rhino/client.py | gonzalocasas/compas | 2fabc7e5c966a02d823fa453564151e1a1e7e3c6 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import time
try:
from comtypes.client import CreateObject
from comtypes.client import GetModule
except ImportError:
import platform
if 'windows' in platform.system().lower():
raise
__... | 24.607843 | 106 | 0.579681 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import time
try:
from comtypes.client import CreateObject
from comtypes.client import GetModule
except ImportError:
import platform
if 'windows' in platform.system().lower():
raise
__... | true | true |
1c18ad07e99b97b070830a4825357e33467968c6 | 373 | py | Python | tests/conftest.py | pthomson88/drug_design | d92ed4c06cd036c83fe60ada05b493f4581d24d6 | [
"MIT"
] | 1 | 2020-07-06T10:50:17.000Z | 2020-07-06T10:50:17.000Z | tests/conftest.py | pthomson88/drug_design | d92ed4c06cd036c83fe60ada05b493f4581d24d6 | [
"MIT"
] | 3 | 2020-04-06T22:06:07.000Z | 2020-04-23T23:07:43.000Z | tests/conftest.py | pthomson88/drug_design | d92ed4c06cd036c83fe60ada05b493f4581d24d6 | [
"MIT"
] | null | null | null | #We're in the test directory so we need to jump back to the root dir to find modules
import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import pytest
from main import create_app
@pytest.fixt... | 24.866667 | 86 | 0.761394 | import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import pytest
from main import create_app
@pytest.fixture
def app():
app = create_app()
return app
| true | true |
1c18adb953f8c8e58cb288401e3a06a1ffbbaec5 | 10,162 | py | Python | splitcross.py | HuthLab/multi-timescale-LSTM-LMs | d27de333b11f29d898069e852eaf45ca39d903a8 | [
"BSD-3-Clause"
] | 5 | 2021-04-26T18:31:13.000Z | 2021-11-08T23:37:07.000Z | splitcross.py | HuthLab/multi-timescale-LSTM-LMs | d27de333b11f29d898069e852eaf45ca39d903a8 | [
"BSD-3-Clause"
] | null | null | null | splitcross.py | HuthLab/multi-timescale-LSTM-LMs | d27de333b11f29d898069e852eaf45ca39d903a8 | [
"BSD-3-Clause"
] | 2 | 2021-04-21T18:29:37.000Z | 2021-11-14T02:52:53.000Z | from collections import defaultdict
import torch
import torch.nn as nn
import numpy as np
class SplitCrossEntropyLoss(nn.Module):
r'''SplitCrossEntropyLoss calculates an approximate softmax'''
def __init__(self, hidden_size, splits, verbose=False):
# We assume splits is [0, split1, split2, N] where ... | 49.570732 | 135 | 0.62163 | from collections import defaultdict
import torch
import torch.nn as nn
import numpy as np
class SplitCrossEntropyLoss(nn.Module):
def __init__(self, hidden_size, splits, verbose=False):
super(SplitCrossEntropyLoss, self).__init__()
self.hidden_size = hidden_size
self.spli... | true | true |
1c18ae36a7985ae97892a676430379f8f147c144 | 4,096 | py | Python | ctxpredict/ioutil.py | stephenroller/naacl2016 | 486ded494fe5d115a426efea66897632d3e33253 | [
"MIT"
] | 5 | 2016-09-03T22:39:11.000Z | 2021-08-31T03:50:39.000Z | ctxpredict/ioutil.py | stephenroller/naacl2016 | 486ded494fe5d115a426efea66897632d3e33253 | [
"MIT"
] | 2 | 2019-08-13T19:42:46.000Z | 2020-02-05T13:01:58.000Z | ctxpredict/ioutil.py | stephenroller/naacl2016 | 486ded494fe5d115a426efea66897632d3e33253 | [
"MIT"
] | 1 | 2018-06-20T05:13:18.000Z | 2018-06-20T05:13:18.000Z | #!/usr/bin/env python
import os
import os.path
import logging
import itertools
import numpy as np
# before anything else, configure the logger
logger = logging.getLogger()
handler = logging.StreamHandler()
formatter = logging.Formatter("%(asctime)s %(levelname)-8s %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
handler.s... | 28.054795 | 103 | 0.578369 | import os
import os.path
import logging
import itertools
import numpy as np
logger = logging.getLogger()
handler = logging.StreamHandler()
formatter = logging.Formatter("%(asctime)s %(levelname)-8s %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(l... | true | true |
1c18b03538e58a6471d6655b2b4454927c57a465 | 4,287 | py | Python | ucsmsdk/mometa/fabric/FabricCdpLinkPolicy.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/fabric/FabricCdpLinkPolicy.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/fabric/FabricCdpLinkPolicy.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for FabricCdpLinkPolicy ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class FabricCdpLinkPolicyConsts:
ADMIN_STATE_DISABLED = "disabled"
ADMIN_STATE_ENABLED = "enabled"
... | 57.16 | 248 | 0.641241 |
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class FabricCdpLinkPolicyConsts:
ADMIN_STATE_DISABLED = "disabled"
ADMIN_STATE_ENABLED = "enabled"
INT_ID_NONE = "none"
POLICY_OWNER_LOCAL = "local"
POLICY_OWNER_PENDING_POLICY ... | true | true |
1c18b04c840ef1c79b9f3cc302070d4c0ed94e30 | 3,288 | py | Python | tests/integration/local/invoke/invoke_integ_base.py | michael-k/aws-sam-cli | a8525fc8157d507c4b102477ded4d221deaed145 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | tests/integration/local/invoke/invoke_integ_base.py | michael-k/aws-sam-cli | a8525fc8157d507c4b102477ded4d221deaed145 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | tests/integration/local/invoke/invoke_integ_base.py | michael-k/aws-sam-cli | a8525fc8157d507c4b102477ded4d221deaed145 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | import os
from typing import Optional
from unittest import TestCase, skipIf
from pathlib import Path
from subprocess import Popen, PIPE, TimeoutExpired
from tests.testing_utils import SKIP_DOCKER_MESSAGE, SKIP_DOCKER_TESTS
TIMEOUT = 300
@skipIf(SKIP_DOCKER_TESTS, SKIP_DOCKER_MESSAGE)
class InvokeIntegBase(TestCase)... | 28.842105 | 118 | 0.613443 | import os
from typing import Optional
from unittest import TestCase, skipIf
from pathlib import Path
from subprocess import Popen, PIPE, TimeoutExpired
from tests.testing_utils import SKIP_DOCKER_MESSAGE, SKIP_DOCKER_TESTS
TIMEOUT = 300
@skipIf(SKIP_DOCKER_TESTS, SKIP_DOCKER_MESSAGE)
class InvokeIntegBase(TestCase)... | true | true |
1c18b084c27621e166fb79e3d3cc234123242155 | 3,531 | py | Python | src/scheduler/scheduler/application/StartJob/StartJobCommandHandler.py | ahmetcagriakca/pythondataintegrator | 079b968d6c893008f02c88dbe34909a228ac1c7b | [
"MIT"
] | 1 | 2020-12-18T21:37:28.000Z | 2020-12-18T21:37:28.000Z | src/scheduler/scheduler/application/StartJob/StartJobCommandHandler.py | ahmetcagriakca/pythondataintegrator | 079b968d6c893008f02c88dbe34909a228ac1c7b | [
"MIT"
] | null | null | null | src/scheduler/scheduler/application/StartJob/StartJobCommandHandler.py | ahmetcagriakca/pythondataintegrator | 079b968d6c893008f02c88dbe34909a228ac1c7b | [
"MIT"
] | 1 | 2020-12-18T21:37:31.000Z | 2020-12-18T21:37:31.000Z | import time
from datetime import datetime
from injector import inject
from pdip.configuration.models.application import ApplicationConfig
from pdip.configuration.models.database import DatabaseConfig
from pdip.configuration.services import ConfigService
from pdip.cqrs import ICommandHandler, Dispatcher
from pdip.data.... | 47.08 | 152 | 0.678278 | import time
from datetime import datetime
from injector import inject
from pdip.configuration.models.application import ApplicationConfig
from pdip.configuration.models.database import DatabaseConfig
from pdip.configuration.services import ConfigService
from pdip.cqrs import ICommandHandler, Dispatcher
from pdip.data.... | true | true |
1c18b0f977176044faec0041919dc0ccc19f0e53 | 677 | py | Python | LeetCode-Python3/905. sortArrayByParity.py | YaoYilin/LeetCode | ae5933586d05b092acc600e77d055412bc3aaaa7 | [
"MIT"
] | 19 | 2018-04-09T07:26:56.000Z | 2021-11-27T17:35:08.000Z | LeetCode-Python3/905. sortArrayByParity.py | YaoYilin/LeetCode | ae5933586d05b092acc600e77d055412bc3aaaa7 | [
"MIT"
] | null | null | null | LeetCode-Python3/905. sortArrayByParity.py | YaoYilin/LeetCode | ae5933586d05b092acc600e77d055412bc3aaaa7 | [
"MIT"
] | 4 | 2020-03-15T16:09:59.000Z | 2021-06-14T18:04:30.000Z | # -*- coding: utf-8 -*-
# 905. 按奇偶排序数组
# https://leetcode-cn.com/problems/sort-array-by-parity/
'''
给定一个非负整数数组 A,返回一个由 A 的所有偶数元素组成的数组,后面跟 A 的所有奇数元素。
你可以返回满足此条件的任何数组作为答案。
示例:
输入:[3,1,2,4]
输出:[2,4,3,1]
输出 [4,2,3,1],[2,4,1,3] 和 [4,2,1,3] 也会被接受。
提示:
1 <= A.length <= 5000
0 <= A[i] <= 5000
'''
class Solution:
de... | 16.925 | 56 | 0.422452 |
class Solution:
def sortArrayByParity(self, A):
i = 0
r = len(A) - 1
while (i < r):
t = A[i]
if (t % 2 != 0):
A[i] = A[r]
A[r] = t
r = r - 1
else:
i = i + 1
return A
| true | true |
1c18b1d2a7d7628b7aeb6fdb6c4ab5a096e9edf8 | 1,504 | py | Python | scripts/spm_decode.py | fairseq-FT/fairseq | 18725499144c1bba7c151b796ba774e59d36eaa9 | [
"MIT"
] | 16,259 | 2018-05-02T02:31:30.000Z | 2022-03-31T21:50:23.000Z | scripts/spm_decode.py | fairseq-FT/fairseq | 18725499144c1bba7c151b796ba774e59d36eaa9 | [
"MIT"
] | 3,863 | 2018-05-02T13:42:39.000Z | 2022-03-31T19:03:32.000Z | scripts/spm_decode.py | fairseq-FT/fairseq | 18725499144c1bba7c151b796ba774e59d36eaa9 | [
"MIT"
] | 4,796 | 2018-05-02T07:55:51.000Z | 2022-03-31T14:46:45.000Z | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
... | 27.851852 | 83 | 0.631649 |
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import sentencepiece as spm
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"--model", required=True, help="sentencepiece model to use for decoding"
)
parser.add_argument("... | true | true |
1c18b24c40d3babc7d4db07168f6e3fb43db180d | 9,587 | py | Python | tests/services/segmentor/test_starts_with_operand.py | MDAkramSiddiqui/vwo-python-sdk | ebd194931a42111fdfdfa16a7888dce1754d345c | [
"Apache-2.0"
] | 14 | 2019-08-06T06:57:46.000Z | 2022-01-05T13:27:50.000Z | tests/services/segmentor/test_starts_with_operand.py | MDAkramSiddiqui/vwo-python-sdk | ebd194931a42111fdfdfa16a7888dce1754d345c | [
"Apache-2.0"
] | 3 | 2019-08-19T10:29:17.000Z | 2021-09-16T15:59:38.000Z | tests/services/segmentor/test_starts_with_operand.py | MDAkramSiddiqui/vwo-python-sdk | ebd194931a42111fdfdfa16a7888dce1754d345c | [
"Apache-2.0"
] | 10 | 2019-08-08T12:38:50.000Z | 2021-09-14T11:35:00.000Z | # Copyright 2019-2021 Wingify Software Pvt. Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 39.130612 | 101 | 0.659435 |
import unittest
import json
from vwo.services.segmentor.segment_evaluator import SegmentEvaluator
with open("tests/data/segmentor_test_cases.json") as json_file:
segmentor_test_cases = json.load(json_file)
class TestStartsWithOperand(unittest.TestCase):
def setUp(self):
self.segment_evaluator = Seg... | true | true |
1c18b2cfbf21e78cc4ac3a1e213794d164ffc7cc | 4,685 | py | Python | poplar/train/tests/test_ppi.py | mortonjt/poplar | 854d1ef819392f54536df386ef034091831802ed | [
"BSD-3-Clause"
] | null | null | null | poplar/train/tests/test_ppi.py | mortonjt/poplar | 854d1ef819392f54536df386ef034091831802ed | [
"BSD-3-Clause"
] | null | null | null | poplar/train/tests/test_ppi.py | mortonjt/poplar | 854d1ef819392f54536df386ef034091831802ed | [
"BSD-3-Clause"
] | null | null | null | import os
import unittest
from poplar.train.ppi import ppi, train
from poplar.util import get_data_path, dictionary
from poplar.model.dummy import DummyModel
from poplar.model.ppibinder import PPIBinder
from poplar.dataset.interactions import NegativeSampler, InteractionDataDirectory
import shutil
# import numpy as n... | 33.705036 | 90 | 0.628815 | import os
import unittest
from poplar.train.ppi import ppi, train
from poplar.util import get_data_path, dictionary
from poplar.model.dummy import DummyModel
from poplar.model.ppibinder import PPIBinder
from poplar.dataset.interactions import NegativeSampler, InteractionDataDirectory
import shutil
class TestTrainin... | true | true |
1c18b304661ca57576a1d4e69ad858df16f9b330 | 2,070 | py | Python | setup.py | Accelize/acid-cli | 72d038336af34e45c9498332a65ca5188b96cca3 | [
"Apache-2.0"
] | null | null | null | setup.py | Accelize/acid-cli | 72d038336af34e45c9498332a65ca5188b96cca3 | [
"Apache-2.0"
] | null | null | null | setup.py | Accelize/acid-cli | 72d038336af34e45c9498332a65ca5188b96cca3 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
"""Setup script"""
from os import chdir
from os.path import dirname, abspath, join
from setuptools import setup, find_packages
from subprocess import run
PACKAGE_INFO = dict(
name="acidcli",
description="On-demand Azure Pipeline cloud self-hosted agent",
long_description_content_ty... | 35.689655 | 81 | 0.63913 | from os import chdir
from os.path import dirname, abspath, join
from setuptools import setup, find_packages
from subprocess import run
PACKAGE_INFO = dict(
name="acidcli",
description="On-demand Azure Pipeline cloud self-hosted agent",
long_description_content_type="text/markdown; charset=UTF-8",
clas... | true | true |
1c18b52cde474e148f8af39634b7c18e9e46518a | 8,181 | py | Python | code/miscc/losses.py | DenisDiachkov/AttnGAN | f8800539de20e77a08ec3ae371a29ce94769be40 | [
"MIT"
] | null | null | null | code/miscc/losses.py | DenisDiachkov/AttnGAN | f8800539de20e77a08ec3ae371a29ce94769be40 | [
"MIT"
] | null | null | null | code/miscc/losses.py | DenisDiachkov/AttnGAN | f8800539de20e77a08ec3ae371a29ce94769be40 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
from miscc.config import cfg
from GlobalAttention import func_attention
# ##################Loss for matching text-image###################
def cosine_similarity(x1, x2, dim=1, eps=1e-8):
"""Returns cosine similarity between x1 and x2, computed along dim.
... | 38.051163 | 98 | 0.599682 | import torch
import torch.nn as nn
import numpy as np
from miscc.config import cfg
from GlobalAttention import func_attention
def cosine_similarity(x1, x2, dim=1, eps=1e-8):
w12 = torch.sum(x1 * x2, dim)
w1 = torch.norm(x1, 2, dim)
w2 = torch.norm(x2, 2, dim)
return (w12 / (w1 * w2).clamp(min=eps)).... | true | true |
1c18b5989b348ccc62d958d57939cf594634259f | 5,322 | py | Python | build-support/gen_version_info.py | everyonce/yugabyte-db | 37b38568bf5d39cda8a77ef7c48c277cc033fbd0 | [
"Apache-2.0"
] | null | null | null | build-support/gen_version_info.py | everyonce/yugabyte-db | 37b38568bf5d39cda8a77ef7c48c277cc033fbd0 | [
"Apache-2.0"
] | null | null | null | build-support/gen_version_info.py | everyonce/yugabyte-db | 37b38568bf5d39cda8a77ef7c48c277cc033fbd0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | 37.744681 | 99 | 0.662345 |
import json
import logging
import argparse
import os
import re
import sha
import subprocess
import sys
import time
from time import strftime, localtime
def main():
logging.basicConfig(
level=logging.INFO,
format="[" + os.path.basename(__file__) + "] %(asctime)s %(levelname)s: %(message)s")
p... | false | true |
1c18b6c3b885f2caf19a2345653c7b3485fd7193 | 782 | py | Python | src/learn_word/migrations/0017_auto_20200512_1032.py | kamei002/LET | 7aa7b99d65fff3c22f021ba627ba545e46a0d209 | [
"MIT"
] | null | null | null | src/learn_word/migrations/0017_auto_20200512_1032.py | kamei002/LET | 7aa7b99d65fff3c22f021ba627ba545e46a0d209 | [
"MIT"
] | 5 | 2021-03-30T13:16:48.000Z | 2021-12-13T20:38:15.000Z | src/learn_word/migrations/0017_auto_20200512_1032.py | kamei002/LET | 7aa7b99d65fff3c22f021ba627ba545e46a0d209 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-05-12 01:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('learn_word', '0016_auto_20200512_0845'),
]
operations = [
migrations.AlterField(
model_name='define',
name='meaning_... | 24.4375 | 62 | 0.556266 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('learn_word', '0016_auto_20200512_0845'),
]
operations = [
migrations.AlterField(
model_name='define',
name='meaning_en',
field=models.TextField(null=Tru... | true | true |
1c18b82e851539f5718ee4d95b224d4057ea34fa | 768 | py | Python | sample_company/migrations/0001_initial.py | ptrck/django-clone | 5c868b65ac6a3e3367595f8aa54abc42ef0d0144 | [
"MIT"
] | null | null | null | sample_company/migrations/0001_initial.py | ptrck/django-clone | 5c868b65ac6a3e3367595f8aa54abc42ef0d0144 | [
"MIT"
] | null | null | null | sample_company/migrations/0001_initial.py | ptrck/django-clone | 5c868b65ac6a3e3367595f8aa54abc42ef0d0144 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-16 17:33
from django.db import migrations, models
import model_clone.mixins.clone
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="CompanyDepot",
fields=[
... | 24.774194 | 70 | 0.470052 |
from django.db import migrations, models
import model_clone.mixins.clone
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="CompanyDepot",
fields=[
(
"id",
... | true | true |
1c18b889d115b7394e4f06c6e82b2081edd4c9cc | 1,819 | py | Python | iDash/migrations/0001_initial.py | gaiusyao/iDash | ec3f9c07927d3fa4afb3e1daabed65f544c6f48e | [
"MIT"
] | 2 | 2018-04-10T02:27:07.000Z | 2018-04-11T01:02:21.000Z | iDash/migrations/0001_initial.py | gaiusyao/iDash | ec3f9c07927d3fa4afb3e1daabed65f544c6f48e | [
"MIT"
] | null | null | null | iDash/migrations/0001_initial.py | gaiusyao/iDash | ec3f9c07927d3fa4afb3e1daabed65f544c6f48e | [
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2018-04-09 02:25
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 36.38 | 120 | 0.57669 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
1c18b95014b15150c8a7b6d81c26f1f3f2dde283 | 639 | py | Python | examples/score/1_check_phone_number_risk_level.py | mpadilla2020/python_telesign | eaa9ca819243afdc9e9b27a8c1778d05a03be993 | [
"MIT"
] | 14 | 2016-05-23T10:09:28.000Z | 2021-11-08T09:39:03.000Z | examples/score/1_check_phone_number_risk_level.py | MalingasCUMBANE/python_telesign | 60329eadf903827bb5094be5004c6fa17b19af79 | [
"MIT"
] | 6 | 2015-09-18T14:30:14.000Z | 2020-12-22T09:52:33.000Z | examples/score/1_check_phone_number_risk_level.py | MalingasCUMBANE/python_telesign | 60329eadf903827bb5094be5004c6fa17b19af79 | [
"MIT"
] | 25 | 2015-02-11T20:27:31.000Z | 2021-12-16T10:27:10.000Z | from __future__ import print_function
from telesign.score import ScoreClient
customer_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
api_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
phone_number = "phone_number"
account_lifecycle_event = "create"
data = ScoreClient(cu... | 35.5 | 108 | 0.757433 | from __future__ import print_function
from telesign.score import ScoreClient
customer_id = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890"
api_key = "EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw=="
phone_number = "phone_number"
account_lifecycle_event = "create"
data = ScoreClient(cu... | true | true |
1c18b9e9d9fb7b5d63fda0b94d2d35106da72994 | 607 | py | Python | src/mender/statemachine/__init__.py | pasinskim/mender-python-client | d6f3dc86ec46b0b249a112c5037bea579266e649 | [
"Apache-2.0"
] | null | null | null | src/mender/statemachine/__init__.py | pasinskim/mender-python-client | d6f3dc86ec46b0b249a112c5037bea579266e649 | [
"Apache-2.0"
] | 71 | 2020-12-21T05:08:13.000Z | 2022-01-31T02:04:26.000Z | src/mender/statemachine/__init__.py | pasinskim/mender-python-client | d6f3dc86ec46b0b249a112c5037bea579266e649 | [
"Apache-2.0"
] | 11 | 2020-12-02T14:46:58.000Z | 2021-12-02T06:43:25.000Z | # Copyright 2020 Northern.tech AS
#
# 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 ag... | 43.357143 | 77 | 0.729819 | true | true | |
1c18b9f46f1d49cff2d2fc132f700efae44b1063 | 54,198 | py | Python | Cartwheel/lib/Python26/Lib/site-packages/wx-2.8-msw-unicode/wx/py/shell.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/wx-2.8-msw-unicode/wx/py/shell.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/wx-2.8-msw-unicode/wx/py/shell.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | """Shell is an interactive text control in which a user types in
commands to be sent to the interpreter. This particular shell is
based on wxPython's wxStyledTextCtrl.
Sponsored by Orbtech - Your source for Python programming expertise."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
__cvsid__ = "$Id: she... | 36.350101 | 113 | 0.565501 | """Shell is an interactive text control in which a user types in
commands to be sent to the interpreter. This particular shell is
based on wxPython's wxStyledTextCtrl.
Sponsored by Orbtech - Your source for Python programming expertise."""
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
__cvsid__ = "$Id: she... | false | true |
1c18bb1c0a7b42881319adb6cfc41aaadb665304 | 1,059 | py | Python | deploy/test/sp_test5_3.py | zhexiao/mnet | 51e64e6c5181702f90d4f68efb5e4ba8f20dff7b | [
"Apache-2.0"
] | 19 | 2019-04-05T03:39:51.000Z | 2021-11-09T10:55:58.000Z | deploy/test/sp_test5_3.py | zhexiao/mnet | 51e64e6c5181702f90d4f68efb5e4ba8f20dff7b | [
"Apache-2.0"
] | 3 | 2017-08-04T07:37:31.000Z | 2021-06-10T19:42:58.000Z | deploy/test/sp_test5_3.py | zhexiao/mnet | 51e64e6c5181702f90d4f68efb5e4ba8f20dff7b | [
"Apache-2.0"
] | 11 | 2017-08-02T09:14:45.000Z | 2021-05-07T15:33:07.000Z | from pyspark.sql import SparkSession
from pyspark.sql.functions import explode, split, window
spark = SparkSession.builder.master(
"spark://192.168.33.50:7077"
).getOrCreate()
stream_data = spark \
.readStream \
.format("socket") \
.option("host", "localhost") \
.option("port", 9999) \
.option... | 22.0625 | 71 | 0.640227 | from pyspark.sql import SparkSession
from pyspark.sql.functions import explode, split, window
spark = SparkSession.builder.master(
"spark://192.168.33.50:7077"
).getOrCreate()
stream_data = spark \
.readStream \
.format("socket") \
.option("host", "localhost") \
.option("port", 9999) \
.option... | true | true |
1c18be92e833f954e1d146f6d2e567202aa228e1 | 1,148 | py | Python | class5.py | PRASAD-DANGARE/PYTHON | 36214f7dc3762d327e5a29e40752edeb098249c8 | [
"MIT"
] | 1 | 2021-06-07T07:55:28.000Z | 2021-06-07T07:55:28.000Z | class5.py | PRASAD-DANGARE/PYTHON | 36214f7dc3762d327e5a29e40752edeb098249c8 | [
"MIT"
] | null | null | null | class5.py | PRASAD-DANGARE/PYTHON | 36214f7dc3762d327e5a29e40752edeb098249c8 | [
"MIT"
] | null | null | null | # Python Program To Create Emp Class
# And Make All The Members Of The Emp Class Available To Another Class ie. Myclass
'''
Function Name : This Class Contain Employee Details.
Function Date : 17 Sep 2020
Function Author : Prasad Dangare
Input : String,Integer
Output : String,... | 23.428571 | 83 | 0.575784 |
class Emp:
def __init__(self, id, name, salary):
self.id = id
self.name = name
self.salary = salary
def display(self):
print('Id = ', self.id)
print('Name = ', self.name)
print('Salary = ', self.salary)
class ... | true | true |
1c18bf40919f9313a88babd7c0a4a007e1a86aee | 4,437 | py | Python | core/models/Redundant/SeismicNet6LayerEncoder.py | quamernasim/PETAI-master | d76f37bea1e313246a556871c6304370e9a5616b | [
"MIT"
] | 1 | 2020-07-15T09:38:03.000Z | 2020-07-15T09:38:03.000Z | core/models/Redundant/SeismicNet6LayerEncoder.py | quamernasim/PETAI-master | d76f37bea1e313246a556871c6304370e9a5616b | [
"MIT"
] | null | null | null | core/models/Redundant/SeismicNet6LayerEncoder.py | quamernasim/PETAI-master | d76f37bea1e313246a556871c6304370e9a5616b | [
"MIT"
] | null | null | null | """
This is our proposed Seismic Net for semantic segmentation of facies from seismic images. This Network has
residual connections in both Encoder and Decoder. It has also long residual skip connections to retain the
spatial locations. Primary investigations shows promising results. Need to play with the a... | 35.782258 | 119 | 0.622943 |
import torch.nn as nn
class ResidualBlock(nn.Module):
def __init__(self, in_channels=64, out_channels=64, kernel_size=3):
super(ResidualBlock, self).__init__()
padding = kernel_size // 2
self.block = nn.Sequential(
nn.Conv2d(in_channels=in_channels, out_channels=out_channels, ... | true | true |
1c18bf979b90ebb5e7259072cf123cd7a33e874d | 8,476 | py | Python | pushkin/tests/request/test_event_requests.py | Nordeus/pushkin | 39f7057d3eb82c811c5c6b795d8bc7df9352a217 | [
"MIT"
] | 281 | 2016-03-29T16:36:22.000Z | 2022-03-13T10:28:10.000Z | pushkin/tests/request/test_event_requests.py | Nordeus/pushkin | 39f7057d3eb82c811c5c6b795d8bc7df9352a217 | [
"MIT"
] | 34 | 2016-04-11T08:48:51.000Z | 2019-08-17T15:36:15.000Z | pushkin/tests/request/test_event_requests.py | Nordeus/pushkin | 39f7057d3eb82c811c5c6b795d8bc7df9352a217 | [
"MIT"
] | 66 | 2016-04-07T14:29:26.000Z | 2022-03-30T13:17:38.000Z | '''
The MIT License (MIT)
Copyright (c) 2016 Nordeus LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, p... | 45.816216 | 460 | 0.769703 | '''
The MIT License (MIT)
Copyright (c) 2016 Nordeus LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, p... | false | true |
1c18c0bab53885db79c09f8898ec80d189e41e76 | 1,202 | py | Python | domains/fetch/problems/manual/problem25_CR.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2021-09-28T12:56:56.000Z | 2021-09-28T12:56:56.000Z | domains/fetch/problems/manual/problem25_CR.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | null | null | null | domains/fetch/problems/manual/problem25_CR.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2022-03-31T16:30:39.000Z | 2022-03-31T16:30:39.000Z | __author__ = 'patras'
from domain_chargeableRobot import *
from timer import DURATION
from state import state
DURATION.TIME = {
'put': 2, #for domain CR
'take': 2,
'perceive': 3,
'charge': 5,
'move': 10,
'moveToEmergency': 10,
'moveCharger': 5,
'addressEmergency': 15,
'wait': 5
}
... | 19.387097 | 65 | 0.514143 | __author__ = 'patras'
from domain_chargeableRobot import *
from timer import DURATION
from state import state
DURATION.TIME = {
'put': 2, 'take': 2,
'perceive': 3,
'charge': 5,
'move': 10,
'moveToEmergency': 10,
'moveCharger': 5,
'addressEmergency': 15,
'wait': 5
}
DURATION.COUNT... | true | true |
1c18c210c2e0d1529a9e3761834911096e6a16f6 | 587 | py | Python | publishconf.py | ELC/pelican-tutorial | 95dfe904dedd7638a414a74a49ce43de1d637509 | [
"MIT"
] | null | null | null | publishconf.py | ELC/pelican-tutorial | 95dfe904dedd7638a414a74a49ce43de1d637509 | [
"MIT"
] | null | null | null | publishconf.py | ELC/pelican-tutorial | 95dfe904dedd7638a414a74a49ce43de1d637509 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
# If your site is available via HTTPS, make sure SITEURL begins with https://
SITEURL = 'https:/... | 23.48 | 77 | 0.739353 |
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = 'https://elc.github.io/pelican-tutorial'
RELATIVE_URLS = True
FEED_ALL_ATOM = 'feeds/all.atom.xml'
CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml'
DELETE_OUTPUT_DIRECTORY = True
| true | true |
1c18c2208375c96f0bf38fc9e6a4e0e3d4b480d4 | 47,807 | py | Python | src/sage/rings/infinity.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/rings/infinity.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/rings/infinity.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | 1 | 2020-07-24T12:20:37.000Z | 2020-07-24T12:20:37.000Z | r"""
Infinity Rings
The unsigned infinity "ring" is the set of two elements
1. infinity
2. A number less than infinity
The rules for arithmetic are that the unsigned infinity ring does
not canonically coerce to any other ring, and all other rings
canonically coerce to the unsigned infinity ring, sending all
element... | 28.171479 | 142 | 0.552388 |
from sage.rings.ring_element import RingElement
from sage.rings.ring import Ring
from sage.structure.element import RingElement, InfinityElement, PlusInfinityElement, MinusInfinityElement
from sage.structure.parent_gens import ParentWithGens
import sage.rings.integer
import sage.rings.rational
from sage.rings.integer... | true | true |
1c18c38dda5e72a6a2cbaf9eaceb59f665f3ee93 | 14,233 | py | Python | examples/language-modeling/run_language_modeling_gen.py | Tarpelite/title_generation | 8b9a9878e42ef1217b346daf492450c3d004dd21 | [
"MIT"
] | 1 | 2020-07-23T11:28:48.000Z | 2020-07-23T11:28:48.000Z | examples/language-modeling/run_language_modeling_gen.py | Tarpelite/title_generation | 8b9a9878e42ef1217b346daf492450c3d004dd21 | [
"MIT"
] | null | null | null | examples/language-modeling/run_language_modeling_gen.py | Tarpelite/title_generation | 8b9a9878e42ef1217b346daf492450c3d004dd21 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 36.401535 | 143 | 0.672592 |
import logging
import math
import os
from dataclasses import dataclass, field
from typing import Optional
from tqdm import tqdm
from transformers import (
CONFIG_MAPPING,
MODEL_WITH_LM_HEAD_MAPPING,
AutoConfig,
AutoModelWithLMHead,
AutoModelForTokenClassification,
AutoModelForSequenceClassific... | true | true |
1c18c46dc652402a65f809452318a360d3f0e276 | 7,757 | py | Python | lib/spack/spack/hooks/sbang.py | MichaelLaufer/spack | 4f124bc9e7897b682fd18d605b6b6a007c7bfa15 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | lib/spack/spack/hooks/sbang.py | MichaelLaufer/spack | 4f124bc9e7897b682fd18d605b6b6a007c7bfa15 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 12 | 2021-07-26T12:06:55.000Z | 2022-03-15T12:08:11.000Z | lib/spack/spack/hooks/sbang.py | MichaelLaufer/spack | 4f124bc9e7897b682fd18d605b6b6a007c7bfa15 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import filecmp
import os
import re
import shutil
import stat
import sys
import tempfile
import llnl.util.filesystem as fs... | 36.938095 | 88 | 0.664045 |
import filecmp
import os
import re
import shutil
import stat
import sys
import tempfile
import llnl.util.filesystem as fs
import llnl.util.tty as tty
import spack.paths
import spack.store
if sys.platform == 'darwin':
system_shebang_limit = 511
else:
system_shebang_limit = 127
spack_shebang_limit = 4096
in... | true | true |
1c18c480fac6bff9736a7a03a41ff3c81d65568a | 15,249 | py | Python | test/test_extension.py | midnightexigent/rocker | 9936a378fc35f1045e558391ebf3e6629620dda2 | [
"Apache-2.0"
] | 259 | 2019-01-09T06:39:04.000Z | 2022-03-30T11:29:04.000Z | test/test_extension.py | midnightexigent/rocker | 9936a378fc35f1045e558391ebf3e6629620dda2 | [
"Apache-2.0"
] | 150 | 2019-01-03T00:06:16.000Z | 2022-03-17T01:44:20.000Z | test/test_extension.py | midnightexigent/rocker | 9936a378fc35f1045e558391ebf3e6629620dda2 | [
"Apache-2.0"
] | 37 | 2019-02-21T20:39:00.000Z | 2022-01-03T20:02:17.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 40.448276 | 114 | 0.679782 |
import argparse
import em
import getpass
import os
import unittest
from pathlib import Path
import pwd
from rocker.core import list_plugins
from rocker.extensions import name_to_argument
def plugin_load_parser_correctly(plugin):
parser = argparse.ArgumentParser(description='test_parser')
plugin.register_ar... | true | true |
1c18c573d239bd9ab29e9ee856ce59c0e7258221 | 106 | py | Python | lib/solutions/CHK/sku.py | DPNT-Sourcecode/CHK-iqfz01 | 3323a233d305a1030834397131bd397df010e3fc | [
"Apache-2.0"
] | null | null | null | lib/solutions/CHK/sku.py | DPNT-Sourcecode/CHK-iqfz01 | 3323a233d305a1030834397131bd397df010e3fc | [
"Apache-2.0"
] | null | null | null | lib/solutions/CHK/sku.py | DPNT-Sourcecode/CHK-iqfz01 | 3323a233d305a1030834397131bd397df010e3fc | [
"Apache-2.0"
] | null | null | null |
class SKU:
def __init__(self, sku_id, price):
self.sku_id = sku_id
self.price = price | 21.2 | 38 | 0.603774 |
class SKU:
def __init__(self, sku_id, price):
self.sku_id = sku_id
self.price = price | true | true |
1c18c654210db7b1513f7e35bc69e1d94dfb1bdc | 1,016 | py | Python | demo/demo_appapi_illust.py | Kyle2142/pixivpy-async | 639ddf46fbeeaa2aade059e4f5eac80bd450ee52 | [
"Unlicense"
] | null | null | null | demo/demo_appapi_illust.py | Kyle2142/pixivpy-async | 639ddf46fbeeaa2aade059e4f5eac80bd450ee52 | [
"Unlicense"
] | null | null | null | demo/demo_appapi_illust.py | Kyle2142/pixivpy-async | 639ddf46fbeeaa2aade059e4f5eac80bd450ee52 | [
"Unlicense"
] | null | null | null | # !/usr/bin/env python
# -*- coding: utf-8 -*-
import asyncio
import sys
from pixivpy_async import AppPixivAPI
sys.dont_write_bytecode = True
_USERNAME = "userbay"
_PASSWORD = "userpay"
async def appapi_illust(aapi):
json_result = await aapi.illust_detail(59580629)
# print(json_result)
illust = json_re... | 21.617021 | 80 | 0.693898 | import asyncio
import sys
from pixivpy_async import AppPixivAPI
sys.dont_write_bytecode = True
_USERNAME = "userbay"
_PASSWORD = "userpay"
async def appapi_illust(aapi):
json_result = await aapi.illust_detail(59580629)
illust = json_result.illust
print(">>> %s, origin url: %s" % (illust.title, illu... | true | true |
1c18c6e4ae1b5f43333a1a075c6df0cb7909e390 | 1,496 | py | Python | geographic_mapping.py | smoorjani/LA-Crime-Analysis | 26dfeae3a1b7e885a9bd1f78af2c5c5df5b7d071 | [
"MIT"
] | null | null | null | geographic_mapping.py | smoorjani/LA-Crime-Analysis | 26dfeae3a1b7e885a9bd1f78af2c5c5df5b7d071 | [
"MIT"
] | null | null | null | geographic_mapping.py | smoorjani/LA-Crime-Analysis | 26dfeae3a1b7e885a9bd1f78af2c5c5df5b7d071 | [
"MIT"
] | null | null | null | import plotly
import plotly.plotly as py
import plotly.graph_objs as go
import pandas as pd
# Plots each crime on a map of Los Angeles
plotly.tools.set_credentials_file(username='smoorjani', api_key='ZNLECT9fuPKYvIqUfd1M')
mapbox_access_token = 'pk.eyJ1Ijoic2FtcmFqbSIsImEiOiJjanFsNnpnMWEwaW83NDJxajE5a3VwYWk... | 23.015385 | 114 | 0.60361 | import plotly
import plotly.plotly as py
import plotly.graph_objs as go
import pandas as pd
plotly.tools.set_credentials_file(username='smoorjani', api_key='ZNLECT9fuPKYvIqUfd1M')
mapbox_access_token = 'pk.eyJ1Ijoic2FtcmFqbSIsImEiOiJjanFsNnpnMWEwaW83NDJxajE5a3VwYWk1In0.5ieoEoWVw4B_xcB8Mi68RA'
df = pd.read... | true | true |
1c18c7918dfb6eaf39509f7a0e7fa4900efb1dd4 | 10,447 | py | Python | tests/darwin/client_test.py | v7labs/darwin-lib | 13efb4867effd3d312bcfafe1ee242aed61fae3a | [
"MIT"
] | 2 | 2019-09-04T13:32:07.000Z | 2019-09-19T10:10:41.000Z | tests/darwin/client_test.py | v7labs/darwin-lib | 13efb4867effd3d312bcfafe1ee242aed61fae3a | [
"MIT"
] | 1 | 2019-09-19T11:17:44.000Z | 2019-09-19T17:34:31.000Z | tests/darwin/client_test.py | v7labs/darwin-cli | 13efb4867effd3d312bcfafe1ee242aed61fae3a | [
"MIT"
] | null | null | null | from pathlib import Path
from typing import Any, Dict, List
import pytest
import responses
from tests.fixtures import *
from darwin.client import Client
from darwin.config import Config
from darwin.dataset.remote_dataset import RemoteDataset
from darwin.datatypes import Feature
from darwin.exceptions import NameTaken... | 35.534014 | 100 | 0.610989 | from pathlib import Path
from typing import Any, Dict, List
import pytest
import responses
from tests.fixtures import *
from darwin.client import Client
from darwin.config import Config
from darwin.dataset.remote_dataset import RemoteDataset
from darwin.datatypes import Feature
from darwin.exceptions import NameTaken... | true | true |
1c18c8ef743991fe2c99a79ac9df3bb30d3981a5 | 1,988 | py | Python | python_modules/dagster/dagster_tests/core_tests/test_compute_only_pipeline.py | shahvineet98/dagster | 2471d39c52f660e23e8c0d8e8ded873ddc3df036 | [
"Apache-2.0"
] | 3 | 2020-09-09T04:10:23.000Z | 2021-11-08T02:10:42.000Z | python_modules/dagster/dagster_tests/core_tests/test_compute_only_pipeline.py | shahvineet98/dagster | 2471d39c52f660e23e8c0d8e8ded873ddc3df036 | [
"Apache-2.0"
] | 2 | 2021-05-11T13:36:27.000Z | 2021-09-03T01:53:11.000Z | python_modules/dagster/dagster_tests/core_tests/test_compute_only_pipeline.py | shahvineet98/dagster | 2471d39c52f660e23e8c0d8e8ded873ddc3df036 | [
"Apache-2.0"
] | 1 | 2021-02-21T12:16:47.000Z | 2021-02-21T12:16:47.000Z | from dagster import InputDefinition, OutputDefinition, execute_pipeline, pipeline
from dagster.core.test_utils import single_output_solid
def _set_key_value(ddict, key, value):
ddict[key] = value
return value
def test_execute_solid_with_dep_only_inputs_no_api():
did_run_dict = {}
step_one_solid = s... | 28.4 | 88 | 0.707243 | from dagster import InputDefinition, OutputDefinition, execute_pipeline, pipeline
from dagster.core.test_utils import single_output_solid
def _set_key_value(ddict, key, value):
ddict[key] = value
return value
def test_execute_solid_with_dep_only_inputs_no_api():
did_run_dict = {}
step_one_solid = s... | true | true |
1c18c96324a6b2e8b41019636fc236e298800db7 | 7,359 | py | Python | caserec/recommenders/item_recommendation/item_attribute_knn.py | khalillakhdhar/recommander_python | 1a29131dd91dc68b271882124abf271177921641 | [
"MIT"
] | 407 | 2018-06-25T18:00:11.000Z | 2022-03-24T17:16:17.000Z | caserec/recommenders/item_recommendation/item_attribute_knn.py | khalillakhdhar/recommander_python | 1a29131dd91dc68b271882124abf271177921641 | [
"MIT"
] | 23 | 2018-06-27T21:19:04.000Z | 2022-01-24T04:20:40.000Z | caserec/recommenders/item_recommendation/item_attribute_knn.py | khalillakhdhar/recommander_python | 1a29131dd91dc68b271882124abf271177921641 | [
"MIT"
] | 77 | 2018-06-24T19:04:18.000Z | 2021-11-29T10:12:36.000Z | # coding=utf-8
""""
Item Based Collaborative Filtering Recommender with Attributes (Item Attribute KNN)
[Item Recommendation (Ranking)]
Its philosophy is as follows: in order to determine the rating of User u on item m, we can find other movies that
are similar to item m, and based on User u’s ratings ... | 45.99375 | 120 | 0.655524 |
from collections import defaultdict
import numpy as np
from caserec.recommenders.item_recommendation.itemknn import ItemKNN
from caserec.utils.process_data import ReadFile
__author__ = 'Arthur Fortes <fortes.arthur@gmail.com>'
class ItemAttributeKNN(ItemKNN):
def __init__(self, train_file=None, test_file=None... | true | true |
1c18cb09f82668b62bdd38a9d95327b2647f322e | 1,936 | py | Python | melati/types/blockchain_format/reward_chain_block.py | luzofex/melati-blockchain | bddc95ed3a8c5631488cd44a9e76b764c19b4568 | [
"Apache-2.0"
] | 12 | 2021-07-13T15:39:57.000Z | 2022-02-09T04:32:12.000Z | melati/types/blockchain_format/reward_chain_block.py | luzofex/melati-blockchain | bddc95ed3a8c5631488cd44a9e76b764c19b4568 | [
"Apache-2.0"
] | 1 | 2021-07-16T12:41:41.000Z | 2021-07-16T12:42:48.000Z | melati/types/blockchain_format/reward_chain_block.py | luzofex/melati-blockchain | bddc95ed3a8c5631488cd44a9e76b764c19b4568 | [
"Apache-2.0"
] | 3 | 2021-07-13T05:35:30.000Z | 2021-08-06T13:11:14.000Z | from dataclasses import dataclass
from typing import Optional
from blspy import G2Element
from melati.types.blockchain_format.proof_of_space import ProofOfSpace
from melati.types.blockchain_format.sized_bytes import bytes32
from melati.types.blockchain_format.vdf import VDFInfo
from melati.util.ints import uint8, uin... | 35.2 | 81 | 0.768595 | from dataclasses import dataclass
from typing import Optional
from blspy import G2Element
from melati.types.blockchain_format.proof_of_space import ProofOfSpace
from melati.types.blockchain_format.sized_bytes import bytes32
from melati.types.blockchain_format.vdf import VDFInfo
from melati.util.ints import uint8, uin... | true | true |
1c18ce8b4b9c9fc7e8226dcb4f26331dfacb16b7 | 2,467 | py | Python | example/testapp/migrations/0001_initial.py | sjkingo/django-admin-sortable2 | 1c0413bfd06e63f54da4cc4ac43fb9970a3fc24f | [
"MIT"
] | null | null | null | example/testapp/migrations/0001_initial.py | sjkingo/django-admin-sortable2 | 1c0413bfd06e63f54da4cc4ac43fb9970a3fc24f | [
"MIT"
] | null | null | null | example/testapp/migrations/0001_initial.py | sjkingo/django-admin-sortable2 | 1c0413bfd06e63f54da4cc4ac43fb9970a3fc24f | [
"MIT"
] | 1 | 2021-06-18T00:44:51.000Z | 2021-06-18T00:44:51.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-11 08:32
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... | 37.953846 | 123 | 0.567086 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
... | true | true |
1c18cf4157940b3d6c79de7081acd5058198b0a3 | 4,156 | py | Python | pipeline/chimera_pipeline/scripts/chimerID/chimerID/logodds.py | bartongroup/Simpson_Barton_Nanopore_1 | 1b509454a9e25a8c81be5092f8e525ca00e7b5a5 | [
"MIT"
] | 8 | 2020-01-21T15:41:46.000Z | 2021-11-30T10:03:13.000Z | pipeline/chimera_pipeline/scripts/chimerID/chimerID/logodds.py | bartongroup/Simpson_Barton_Nanopore_1 | 1b509454a9e25a8c81be5092f8e525ca00e7b5a5 | [
"MIT"
] | 6 | 2020-02-24T16:29:25.000Z | 2021-05-20T09:09:25.000Z | pipeline/chimera_pipeline/scripts/chimerID/chimerID/logodds.py | bartongroup/Simpson_Barton_Nanopore_1 | 1b509454a9e25a8c81be5092f8e525ca00e7b5a5 | [
"MIT"
] | 5 | 2019-12-19T13:56:15.000Z | 2021-11-30T10:03:42.000Z | import itertools as it
import numpy as np
import pandas as pd
from scipy import stats
from statsmodels.stats.multitest import multipletests
def read_all_chimeric_counts(h5_fns, sample_names, normalise=True):
chimeric_counts = {}
all_gene_non_chimeric_counts = {}
for sample, h5_fn in zip(sample_names, h5_f... | 47.770115 | 92 | 0.680462 | import itertools as it
import numpy as np
import pandas as pd
from scipy import stats
from statsmodels.stats.multitest import multipletests
def read_all_chimeric_counts(h5_fns, sample_names, normalise=True):
chimeric_counts = {}
all_gene_non_chimeric_counts = {}
for sample, h5_fn in zip(sample_names, h5_f... | true | true |
1c18cf9de26cb2d06b09bd659636baf76fcd2497 | 1,208 | py | Python | netdata_airflow_utils/datahub.py | netdata/netdata-airflow-utils | e7eb7b06fe427d9a5610eb93bfc409f1cc35675f | [
"Apache-2.0"
] | null | null | null | netdata_airflow_utils/datahub.py | netdata/netdata-airflow-utils | e7eb7b06fe427d9a5610eb93bfc409f1cc35675f | [
"Apache-2.0"
] | null | null | null | netdata_airflow_utils/datahub.py | netdata/netdata-airflow-utils | e7eb7b06fe427d9a5610eb93bfc409f1cc35675f | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: 03_datahub.ipynb (unless otherwise specified).
__all__ = ['make_datahub_lineage_op']
# Cell
import datahub.emitter.mce_builder as builder
from datahub_provider.operators.datahub import DatahubEmitterOperator
from .utils import dest
from typing import List
# Cell
def ma... | 36.606061 | 115 | 0.675497 |
__all__ = ['make_datahub_lineage_op']
import datahub.emitter.mce_builder as builder
from datahub_provider.operators.datahub import DatahubEmitterOperator
from .utils import dest
from typing import List
def make_datahub_lineage_op(upstream_urns: List[str], downstream_urn: str, task_id: str = None,
... | true | true |
1c18cfa792679e35b8e7608eca9cca17b4689c4e | 647 | py | Python | LeetCode/missingNumber.py | userforbidden/Python-Samples | 95c4cd12d59ff2f974744c335597ca3e3dcb9f2d | [
"MIT"
] | 1 | 2019-11-08T21:06:00.000Z | 2019-11-08T21:06:00.000Z | LeetCode/missingNumber.py | userforbidden/Python-Samples | 95c4cd12d59ff2f974744c335597ca3e3dcb9f2d | [
"MIT"
] | null | null | null | LeetCode/missingNumber.py | userforbidden/Python-Samples | 95c4cd12d59ff2f974744c335597ca3e3dcb9f2d | [
"MIT"
] | null | null | null | #Hash set
class Solution1:
def missingNumber(self, nums):
num_set = set(nums)
n = len(nums) + 1
for number in range(n):
if number not in num_set:
return number
#Approach #3 Bit Manipulation [Accepted]
class Solution2:
def missingNumber(self, nums):
... | 25.88 | 49 | 0.598145 | class Solution1:
def missingNumber(self, nums):
num_set = set(nums)
n = len(nums) + 1
for number in range(n):
if number not in num_set:
return number
class Solution2:
def missingNumber(self, nums):
missing = len(nums)
for i, num in enumerate... | true | true |
1c18cfc9accecb70671ba268645272c4e1f06fa9 | 2,132 | py | Python | atomate/vasp/config.py | Zhuoying/atomate | 067023f0f740d3abac47b7ae7743c1c31eff8a06 | [
"BSD-3-Clause-LBNL"
] | 167 | 2017-01-26T00:14:19.000Z | 2022-03-18T20:47:58.000Z | atomate/vasp/config.py | Zhuoying/atomate | 067023f0f740d3abac47b7ae7743c1c31eff8a06 | [
"BSD-3-Clause-LBNL"
] | 422 | 2016-12-16T18:21:15.000Z | 2022-03-23T22:13:19.000Z | atomate/vasp/config.py | Zhuoying/atomate | 067023f0f740d3abac47b7ae7743c1c31eff8a06 | [
"BSD-3-Clause-LBNL"
] | 158 | 2016-12-16T18:28:00.000Z | 2022-03-28T11:40:03.000Z | __author__ = "Anubhav Jain <ajain@lbl.gov>"
# TODO: @computron should be able to load from YAML -computron
ADD_NAMEFILE = True
SCRATCH_DIR = ">>scratch_dir<<"
GAMMA_VASP_CMD = ">>gamma_vasp_cmd<<"
SMALLGAP_KPOINT_MULTIPLY = True
ADD_MODIFY_INCAR = False
STABILITY_CHECK = False
VASP_CMD = ">>vasp_cmd<<"
VDW_KERNEL_DIR... | 27.333333 | 87 | 0.713415 | __author__ = "Anubhav Jain <ajain@lbl.gov>"
ADD_NAMEFILE = True
SCRATCH_DIR = ">>scratch_dir<<"
GAMMA_VASP_CMD = ">>gamma_vasp_cmd<<"
SMALLGAP_KPOINT_MULTIPLY = True
ADD_MODIFY_INCAR = False
STABILITY_CHECK = False
VASP_CMD = ">>vasp_cmd<<"
VDW_KERNEL_DIR = ">>vdw_kernel_dir<<"
DB_FILE = ">>db_file<<"
ADD_WF_METADATA... | true | true |
1c18cfeea0692bc2d24c2d5a9727f2bd5a286c1c | 3,081 | py | Python | modules/android/android.py | GDGSNF/PXXTF | b1e081348c1e993c61213f3fd5f960894ce91d01 | [
"MIT"
] | 16 | 2020-10-03T22:01:46.000Z | 2021-08-18T16:58:56.000Z | modules/android/android.py | GDGSNF/PXXTF | b1e081348c1e993c61213f3fd5f960894ce91d01 | [
"MIT"
] | 1 | 2021-10-18T00:13:27.000Z | 2021-10-18T00:13:31.000Z | modules/android/android.py | yezz123/PXXTF | b1e081348c1e993c61213f3fd5f960894ce91d01 | [
"MIT"
] | 5 | 2020-10-16T11:07:45.000Z | 2021-05-19T23:49:06.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
R = '\033[31m' # Red
N = '\033[1;37m' # White
B = '\033[1;34m' #Blue
G = '\033[32m' # Green
import os, sys, subprocess
from time import sleep
import importlib
importlib.reload(sys)
sys.setdefaultencoding("utf-8")
host = " "
port = " "
output = " "
def help():
print("""
... | 32.09375 | 139 | 0.45667 | R = '\033[31m' N = '\033[1;37m' B = '\033[1;34m' G = '\033[32m' import os, sys, subprocess
from time import sleep
import importlib
importlib.reload(sys)
sys.setdefaultencoding("utf-8")
host = " "
port = " "
output = " "
def help():
print("""
Global Options
============
Name Description
... | true | true |
1c18d02fa99c3caad7ab306619e1ec553adf229e | 148 | py | Python | src/blogbuilder/rendering/markdown_renderer.py | th3james/BlogBuilder | d2b641a78b016b79dcdcc5acc3b68fcdef202a6f | [
"MIT"
] | null | null | null | src/blogbuilder/rendering/markdown_renderer.py | th3james/BlogBuilder | d2b641a78b016b79dcdcc5acc3b68fcdef202a6f | [
"MIT"
] | null | null | null | src/blogbuilder/rendering/markdown_renderer.py | th3james/BlogBuilder | d2b641a78b016b79dcdcc5acc3b68fcdef202a6f | [
"MIT"
] | null | null | null | from commonmark import commonmark
class MarkdownRenderer:
def render(self, markdown_str: str) -> str:
return commonmark(markdown_str)
| 21.142857 | 47 | 0.743243 | from commonmark import commonmark
class MarkdownRenderer:
def render(self, markdown_str: str) -> str:
return commonmark(markdown_str)
| true | true |
1c18d07c7b015ddea6ff649f197e83ea6f102821 | 141 | py | Python | mypower/matpower_ported/lib/isload.py | yasirroni/mypower | 123c2d3380bf5f753a479c35e7b5cbafc82a8ebc | [
"Apache-2.0"
] | 2 | 2020-08-08T15:13:49.000Z | 2021-01-04T07:21:29.000Z | mypower/matpower_ported/lib/isload.py | yasirroni/mypower | 123c2d3380bf5f753a479c35e7b5cbafc82a8ebc | [
"Apache-2.0"
] | null | null | null | mypower/matpower_ported/lib/isload.py | yasirroni/mypower | 123c2d3380bf5f753a479c35e7b5cbafc82a8ebc | [
"Apache-2.0"
] | 1 | 2020-08-08T15:14:17.000Z | 2020-08-08T15:14:17.000Z | def isload(*args,nout=1,oc=None):
if oc == None:
from ...oc_api import oc_matpower
oc = oc_matpower()
return oc.isload(*args,nout=nout)
| 23.5 | 35 | 0.695035 | def isload(*args,nout=1,oc=None):
if oc == None:
from ...oc_api import oc_matpower
oc = oc_matpower()
return oc.isload(*args,nout=nout)
| true | true |
1c18d0b15e5fe73786114bb5c04693194142ea08 | 1,926 | py | Python | examples/Python/Basic/transformation.py | 10imaging/Open3D | 057c1e1c74f58042e6c0da3368eddc6701c53613 | [
"MIT"
] | null | null | null | examples/Python/Basic/transformation.py | 10imaging/Open3D | 057c1e1c74f58042e6c0da3368eddc6701c53613 | [
"MIT"
] | null | null | null | examples/Python/Basic/transformation.py | 10imaging/Open3D | 057c1e1c74f58042e6c0da3368eddc6701c53613 | [
"MIT"
] | null | null | null | # Open3D: www.open3d.org
# The MIT License (MIT)
# See license file or visit www.open3d.org for details
# examples/Python/Utility/transformation.py
import numpy as np
import open3d as o3d
import time
def geometry_generator():
mesh = o3d.geometry.TriangleMesh.create_sphere()
verts = np.asarray(mesh.vertices)... | 27.913043 | 77 | 0.650052 |
import numpy as np
import open3d as o3d
import time
def geometry_generator():
mesh = o3d.geometry.TriangleMesh.create_sphere()
verts = np.asarray(mesh.vertices)
colors = np.random.uniform(0, 1, size=verts.shape)
mesh.vertex_colors = o3d.utility.Vector3dVector(colors)
mesh.compute_vertex_normals(... | true | true |
1c18d0fa72064e7002269c9021b9a3f1c7a6fc0d | 45,453 | py | Python | detectron2/utils/visualizer.py | jorgesantos/Detectron2 | 3bdf3ab4a4626985b3581da0a5b9e8c534b56980 | [
"Apache-2.0"
] | null | null | null | detectron2/utils/visualizer.py | jorgesantos/Detectron2 | 3bdf3ab4a4626985b3581da0a5b9e8c534b56980 | [
"Apache-2.0"
] | null | null | null | detectron2/utils/visualizer.py | jorgesantos/Detectron2 | 3bdf3ab4a4626985b3581da0a5b9e8c534b56980 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import colorsys
import logging
import math
import numpy as np
from enum import Enum, unique
import cv2
import matplotlib as mpl
import matplotlib.colors as mplc
import matplotlib.figure as mplfigure
import pycocotools.mask as mask_util
import torch
... | 39.696943 | 100 | 0.578136 | import colorsys
import logging
import math
import numpy as np
from enum import Enum, unique
import cv2
import matplotlib as mpl
import matplotlib.colors as mplc
import matplotlib.figure as mplfigure
import pycocotools.mask as mask_util
import torch
from fvcore.common.file_io import PathManager
from matplotlib.backends.... | true | true |
1c18d1b704a64fdaa3bd3c919875f3d24b824c7c | 8,276 | py | Python | pycco_resources/__init__.py | tlamadon/pycco | ff2c4a1d0433acf9a6e48c35a117d4a09a918e0b | [
"MIT"
] | 1 | 2019-10-20T21:36:20.000Z | 2019-10-20T21:36:20.000Z | pycco_resources/__init__.py | tlamadon/pycco | ff2c4a1d0433acf9a6e48c35a117d4a09a918e0b | [
"MIT"
] | null | null | null | pycco_resources/__init__.py | tlamadon/pycco | ff2c4a1d0433acf9a6e48c35a117d4a09a918e0b | [
"MIT"
] | null | null | null | css = """\
/*--------------------- Layout and Typography ----------------------------*/
body {
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
font-size: 16px;
line-height: 24px;
color: #252519;
margin: 0; padding: 0;
}
a {
color: #261a3b;
}
a:visited {
color: #261a3b;
... | 34.198347 | 88 | 0.536008 | css = """\
/*--------------------- Layout and Typography ----------------------------*/
body {
font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
font-size: 16px;
line-height: 24px;
color: #252519;
margin: 0; padding: 0;
}
a {
color: #261a3b;
}
a:visited {
color: #261a3b;
... | true | true |
1c18d29b2adc4b7a405dcd5846744828b43ed42c | 321 | py | Python | snipsmanagercore/singleton.py | beevesuw/snipsmanagercore | 93eaaa665887f790a30ba86af5ffee394bfd8ede | [
"MIT"
] | 57 | 2017-12-28T22:50:20.000Z | 2022-01-25T16:05:36.000Z | snipsmanagercore/singleton.py | beevesuw/snipsmanagercore | 93eaaa665887f790a30ba86af5ffee394bfd8ede | [
"MIT"
] | 28 | 2018-04-18T06:45:20.000Z | 2022-03-08T22:50:50.000Z | snipsmanagercore/singleton.py | beevesuw/snipsmanagercore | 93eaaa665887f790a30ba86af5ffee394bfd8ede | [
"MIT"
] | 18 | 2017-12-27T01:57:14.000Z | 2021-03-02T14:13:06.000Z | # -*-: coding utf-8 -*-
""" Singleton class. """
class Singleton(object):
""" Singleton class. """
_instance = None
def __new__(cls, *args, **kwargs):
""" Initialisation. """
if not cls._instance:
cls._instance = super(Singleton, cls).__new__(cls)
return cls._instance... | 21.4 | 62 | 0.566978 |
class Singleton(object):
_instance = None
def __new__(cls, *args, **kwargs):
if not cls._instance:
cls._instance = super(Singleton, cls).__new__(cls)
return cls._instance
| true | true |
1c18d3bfd5a9605c14f4439d65cc95311d54722c | 467 | py | Python | twitter/minitwitter/migrations/0011_auto_20201021_0558.py | chaitraliv/mini-twitter | 99bbfca0b611744c829bca671300aa8dcc356ab1 | [
"MIT"
] | null | null | null | twitter/minitwitter/migrations/0011_auto_20201021_0558.py | chaitraliv/mini-twitter | 99bbfca0b611744c829bca671300aa8dcc356ab1 | [
"MIT"
] | null | null | null | twitter/minitwitter/migrations/0011_auto_20201021_0558.py | chaitraliv/mini-twitter | 99bbfca0b611744c829bca671300aa8dcc356ab1 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-10-21 05:58
import django.contrib.postgres.indexes
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('minitwitter', '0010_auto_20201021_0555'),
]
operations = [
migrations.AddIndex(
model_name='tweet... | 24.578947 | 126 | 0.663812 |
import django.contrib.postgres.indexes
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('minitwitter', '0010_auto_20201021_0555'),
]
operations = [
migrations.AddIndex(
model_name='tweet',
index=django.contrib.postgres.ind... | true | true |
1c18d52abef0f36c505ce8745fdf92c7c19cff64 | 17,519 | py | Python | src/archtive_code/mobile_4wd_driver_hoffman_test5.py | Musyue/mobile_robot | ed8a75c41e8ccaf1b48639239e4119bf2d1d5f65 | [
"MIT"
] | 6 | 2019-08-16T07:29:21.000Z | 2021-12-27T01:25:35.000Z | src/archtive_code/mobile_4wd_driver_hoffman_test5.py | Musyue/mobile_robot | ed8a75c41e8ccaf1b48639239e4119bf2d1d5f65 | [
"MIT"
] | null | null | null | src/archtive_code/mobile_4wd_driver_hoffman_test5.py | Musyue/mobile_robot | ed8a75c41e8ccaf1b48639239e4119bf2d1d5f65 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# coding=utf-8
import rospy
import sys
from std_msgs.msg import String,Float64,Bool,Int64MultiArray
from nav_msgs.msg import Path
from geometry_msgs.msg import Quaternion,Point,Pose
from sensor_msgs.msg import Imu
import time
from math import *
import numpy as np
from mobile_control.mobileplatfo... | 44.017588 | 207 | 0.640105 | import rospy
import sys
from std_msgs.msg import String,Float64,Bool,Int64MultiArray
from nav_msgs.msg import Path
from geometry_msgs.msg import Quaternion,Point,Pose
from sensor_msgs.msg import Imu
import time
from math import *
import numpy as np
from mobile_control.mobileplatform_driver_steptech import *
from geome... | true | true |
1c18d5c469edf0945386b0f874a313b12cfad438 | 4,133 | py | Python | pyro/distributions/transforms/__init__.py | mollerhoj/pyro | 20b476442c8f7a415407ef1770e9abda9df4420d | [
"Apache-2.0"
] | null | null | null | pyro/distributions/transforms/__init__.py | mollerhoj/pyro | 20b476442c8f7a415407ef1770e9abda9df4420d | [
"Apache-2.0"
] | null | null | null | pyro/distributions/transforms/__init__.py | mollerhoj/pyro | 20b476442c8f7a415407ef1770e9abda9df4420d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
from torch.distributions import biject_to, transform_to
from torch.distributions.transforms import * # noqa F403
from torch.distributions.transforms import __all__ as torch_transforms
from pyro.distributions.torch_transform impor... | 40.519608 | 107 | 0.736753 |
from torch.distributions import biject_to, transform_to
from torch.distributions.transforms import * from torch.distributions.transforms import __all__ as torch_transforms
from pyro.distributions.torch_transform import ComposeTransformModule
from pyro.distributions.transforms.affine_autoregressive import AffineAutor... | true | true |
1c18d867808e577359193b7301b8c0ca82c982f5 | 9,553 | py | Python | back/src/features/topic_rank/topicrank.py | mathieu-sibue/preparing-interviews-with-nlp-audio | aac0115d8fd476f7c0a7d9ca500706e839f6382c | [
"MIT"
] | null | null | null | back/src/features/topic_rank/topicrank.py | mathieu-sibue/preparing-interviews-with-nlp-audio | aac0115d8fd476f7c0a7d9ca500706e839f6382c | [
"MIT"
] | null | null | null | back/src/features/topic_rank/topicrank.py | mathieu-sibue/preparing-interviews-with-nlp-audio | aac0115d8fd476f7c0a7d9ca500706e839f6382c | [
"MIT"
] | null | null | null |
"""TopicRank keyphrase extraction model.
Graph-based ranking approach to keyphrase extraction described in:
https://aclanthology.org/I13-1062.pdf
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import string
from itertools import combinations
import ... | 25.818919 | 144 | 0.543704 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import string
from itertools import combinations
import networkx as nx
import numpy as np
from scipy.cluster.hierarchy import linkage, fcluster
from scipy.spatial.distance import pdist
from .base import Load... | true | true |
1c18d8a1fc7d8a2b3584a6065f33addd539b22c8 | 2,486 | py | Python | apps/agentcontroller/jumpscripts/core/system/loghandling.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | 1 | 2015-10-26T10:38:13.000Z | 2015-10-26T10:38:13.000Z | apps/agentcontroller/jumpscripts/core/system/loghandling.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | apps/agentcontroller/jumpscripts/core/system/loghandling.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | from JumpScale import j
descr = """
process logs queued in redis
"""
organization = "jumpscale"
author = "kristof@incubaid.com"
license = "bsd"
version = "1.0"
category = "log.handling.init"
period = 5 # always in sec
startatboot = True
timeout = 4
order = 1
enable = True
async = True
queue ='process'
log = False
ro... | 27.318681 | 84 | 0.649236 | from JumpScale import j
descr = """
process logs queued in redis
"""
organization = "jumpscale"
author = "kristof@incubaid.com"
license = "bsd"
version = "1.0"
category = "log.handling.init"
period = 5 startatboot = True
timeout = 4
order = 1
enable = True
async = True
queue ='process'
log = False
roles = []
try:
... | false | true |
1c18d938a84094991b029df02fe2b75f21093ed2 | 631 | py | Python | plot/plot.py | NatalieBarbosa/hida-datathon-ufz | 6c3272e07696993523fd97e61c38b981852248f4 | [
"MIT"
] | null | null | null | plot/plot.py | NatalieBarbosa/hida-datathon-ufz | 6c3272e07696993523fd97e61c38b981852248f4 | [
"MIT"
] | 3 | 2020-04-02T11:16:58.000Z | 2020-04-02T19:53:48.000Z | plot/plot.py | NatalieBarbosa/hida-datathon-ufz | 6c3272e07696993523fd97e61c38b981852248f4 | [
"MIT"
] | 3 | 2020-04-02T10:40:57.000Z | 2020-04-03T11:57:56.000Z | # -*- coding: utf-8 -*-
# from __future__ import absolute_import
import matplotlib.pyplot as plt
import numpy as np
def plot_time_series_for_locations(time_series_list, time, names, **kwargs):
"""
Parameters
----------
time_series_list : list of array/list
List containing 1D arrays or lists to... | 23.37037 | 76 | 0.633914 | import matplotlib.pyplot as plt
import numpy as np
def plot_time_series_for_locations(time_series_list, time, names, **kwargs):
for time_series, name in zip(time_series_list, names):
plt.plot(time, time_series, label=name, **kwargs)
plt.legend()
plt.show()
| true | true |
1c18d9e3c59d50a4d715b4af1848e3f2f7ec7a3f | 1,455 | py | Python | conv_transformer/UNet/Model.py | chengfenggui/attention-is-all-you-need-pytorch | 368b7c1a48b3c0a495f97de185e336d546aef2cc | [
"MIT"
] | null | null | null | conv_transformer/UNet/Model.py | chengfenggui/attention-is-all-you-need-pytorch | 368b7c1a48b3c0a495f97de185e336d546aef2cc | [
"MIT"
] | null | null | null | conv_transformer/UNet/Model.py | chengfenggui/attention-is-all-you-need-pytorch | 368b7c1a48b3c0a495f97de185e336d546aef2cc | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from .Parts import DoubleConv, Down, Up, OutConv
class UNet(nn.Module):
def __init__(self, in_channels, out_channels, depth=2, bilinear=True):
super(UNet, self).__init__()
self.in_channels = in_channels
self.out... | 30.957447 | 119 | 0.578694 | import torch
import torch.nn as nn
import torch.nn.functional as F
from .Parts import DoubleConv, Down, Up, OutConv
class UNet(nn.Module):
def __init__(self, in_channels, out_channels, depth=2, bilinear=True):
super(UNet, self).__init__()
self.in_channels = in_channels
self.out... | true | true |
1c18da81ba2ebd9b812fa44a542fc672201a28cf | 1,753 | py | Python | pipelines/h5c/rtp/v1/stage_1_task_scripts/build_notebook_readme.py | HERA-Team/hera_pipelines | d2b46bb494dfb020093b807445fc2095d292e898 | [
"BSD-2-Clause"
] | null | null | null | pipelines/h5c/rtp/v1/stage_1_task_scripts/build_notebook_readme.py | HERA-Team/hera_pipelines | d2b46bb494dfb020093b807445fc2095d292e898 | [
"BSD-2-Clause"
] | 9 | 2020-08-14T18:11:40.000Z | 2022-03-18T17:38:03.000Z | pipelines/h5c/rtp/v1/stage_1_task_scripts/build_notebook_readme.py | HERA-Team/hera_pipelines | d2b46bb494dfb020093b807445fc2095d292e898 | [
"BSD-2-Clause"
] | null | null | null | #! /usr/bin/env python3.7
# -*- coding: utf-8 -*-
# Copyright 2021 the HERA Project
# Licensed under the MIT License
import argparse
import os
import glob
starting_dir = os.getcwd()
# Parse arguments and move to target_directory
a = argparse.ArgumentParser(
description='Script for building README files for a fol... | 36.520833 | 146 | 0.687393 |
import argparse
import os
import glob
starting_dir = os.getcwd()
a = argparse.ArgumentParser(
description='Script for building README files for a folder in a github repo with html and ipynb files that link to appropriate preview sites.'
)
a.add_argument("target_dir", help="Path to folder in github repo to make a... | true | true |
1c18dbdad9678ced2ccddc052dac58190f997680 | 5,889 | py | Python | MABtest/generatemu.py | JINJINT/MABtest | e20764baeddf0f32d058c17852eb6981145c15b9 | [
"MIT"
] | 1 | 2021-11-16T09:45:49.000Z | 2021-11-16T09:45:49.000Z | MABtest/generatemu.py | JINJINT/MABtest | e20764baeddf0f32d058c17852eb6981145c15b9 | [
"MIT"
] | null | null | null | MABtest/generatemu.py | JINJINT/MABtest | e20764baeddf0f32d058c17852eb6981145c15b9 | [
"MIT"
] | null | null | null | # scrip fot generate the true mean of the arms according to reward type and time variation
from numpy import sqrt, log, exp, mean, cumsum, zeros, argsort, argmin, argmax, array, random, argwhere, sin, mod, power
from numpy.random import rand
from .toimport import *
from .plotting import *
import dill
import functools
... | 40.061224 | 196 | 0.570216 | from numpy import sqrt, log, exp, mean, cumsum, zeros, argsort, argmin, argmax, array, random, argwhere, sin, mod, power
from numpy.random import rand
from .toimport import *
from .plotting import *
import dill
import functools
def generate_mu_timelist(record_max = 10**4, no_arms = 5, mu_type = 'biggap', is_timevar = ... | true | true |
1c18dc63c30d3d62859fed2e04c183739d886b95 | 13,852 | py | Python | PythonNetwork/venv/Lib/site-packages/matplotlib/tight_layout.py | Moldovandreii/RepetitionCount | b5715b0948b609fde0ce05d45023b7d4cfd635e7 | [
"FTL"
] | 69 | 2020-03-31T06:40:17.000Z | 2022-02-25T11:48:18.000Z | PythonNetwork/venv/Lib/site-packages/matplotlib/tight_layout.py | Moldovandreii/RepetitionCount | b5715b0948b609fde0ce05d45023b7d4cfd635e7 | [
"FTL"
] | 6 | 2018-08-28T12:33:14.000Z | 2019-05-07T20:32:42.000Z | PythonNetwork/venv/Lib/site-packages/matplotlib/tight_layout.py | Moldovandreii/RepetitionCount | b5715b0948b609fde0ce05d45023b7d4cfd635e7 | [
"FTL"
] | 28 | 2020-04-15T15:24:17.000Z | 2021-12-26T04:05:02.000Z | """
This module provides routines to adjust subplot params so that subplots are
nicely fit in the figure. In doing so, only axis labels, tick labels, axes
titles and offsetboxes that are anchored to axes are currently considered.
Internally, it assumes that the margins (left_margin, etc.) which are
differences between... | 36.26178 | 79 | 0.577678 |
import warnings
import matplotlib
from matplotlib.transforms import TransformedBbox, Bbox
from matplotlib.font_manager import FontProperties
rcParams = matplotlib.rcParams
def _get_left(tight_bbox, axes_bbox):
return axes_bbox.xmin - tight_bbox.xmin
def _get_right(tight_bbox, axes_bbox):
return tight_bbo... | true | true |
1c18dc7843d4f12e3b8eb836018f11570a6a8972 | 1,558 | py | Python | setup.py | CounterPillow/click | 2e856a5281a29eb4293059b37427643c3d52a19a | [
"BSD-3-Clause"
] | 1 | 2019-04-14T20:17:11.000Z | 2019-04-14T20:17:11.000Z | setup.py | CounterPillow/click | 2e856a5281a29eb4293059b37427643c3d52a19a | [
"BSD-3-Clause"
] | null | null | null | setup.py | CounterPillow/click | 2e856a5281a29eb4293059b37427643c3d52a19a | [
"BSD-3-Clause"
] | null | null | null | import io
import re
from setuptools import setup
with io.open("README.rst", "rt", encoding="utf8") as f:
readme = f.read()
with io.open("click/__init__.py", "rt", encoding="utf8") as f:
version = re.search(r"__version__ = \'(.*?)\'", f.read()).group(1)
setup(
name="Click",
version=version,
url="h... | 34.622222 | 70 | 0.61104 | import io
import re
from setuptools import setup
with io.open("README.rst", "rt", encoding="utf8") as f:
readme = f.read()
with io.open("click/__init__.py", "rt", encoding="utf8") as f:
version = re.search(r"__version__ = \'(.*?)\'", f.read()).group(1)
setup(
name="Click",
version=version,
url="h... | true | true |
1c18dcc6e47855a196529398cd90b315dcb30746 | 969 | py | Python | fuxi/core/databases/orm/database_base.py | Warlockk/fuxi | 8ef5fe1b36e866b24cf21ddaa9501d843cdbadfd | [
"MIT"
] | 1 | 2020-02-25T15:38:19.000Z | 2020-02-25T15:38:19.000Z | fuxi/core/databases/orm/database_base.py | Warlockk/fuxi | 8ef5fe1b36e866b24cf21ddaa9501d843cdbadfd | [
"MIT"
] | null | null | null | fuxi/core/databases/orm/database_base.py | Warlockk/fuxi | 8ef5fe1b36e866b24cf21ddaa9501d843cdbadfd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : jeffzhang
# @Time : 2019/9/6
# @File : database_base.py
# @Desc : ""
from bson import ObjectId
from fuxi.core.databases.db_mongo import mongo
class DatabaseBase:
def __init__(self):
self.table = ""
def find_one(self):
return... | 26.189189 | 88 | 0.632611 |
from bson import ObjectId
from fuxi.core.databases.db_mongo import mongo
class DatabaseBase:
def __init__(self):
self.table = ""
def find_one(self):
return mongo[self.table].find_one()
def find_by_id(self, _id):
return mongo[self.table].find_one({"_id": ObjectId(str(_id))})
... | true | true |
1c18dd36b6b5f4e22c71a99d9d5f50f72ab4c34b | 895 | py | Python | Python/behavioral_patterns/interpreter/repeat.py | ploukareas/Design-Patterns | 8effde38d73ae9058c3028c97ef395644a90d55b | [
"BSD-3-Clause",
"MIT"
] | 28 | 2018-09-28T07:45:35.000Z | 2022-02-12T12:25:05.000Z | Python/behavioral_patterns/interpreter/repeat.py | ploukareas/Design-Patterns | 8effde38d73ae9058c3028c97ef395644a90d55b | [
"BSD-3-Clause",
"MIT"
] | null | null | null | Python/behavioral_patterns/interpreter/repeat.py | ploukareas/Design-Patterns | 8effde38d73ae9058c3028c97ef395644a90d55b | [
"BSD-3-Clause",
"MIT"
] | 5 | 2021-05-10T23:19:55.000Z | 2022-03-04T20:26:35.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ˅
from behavioral_patterns.interpreter.node import Node
# ˄
# A node corresponding to "repeat".
class Repeat(Node):
# ˅
# ˄
def __init__(self):
self.__number = 0
self.__command_list = None
# ˅
pass
# ˄
def p... | 17.211538 | 85 | 0.569832 | from behavioral_patterns.interpreter.node import Node
class Repeat(Node):
def __init__(self):
self.__number = 0
self.__command_list = None
pass
def parse(self, context):
from behavioral_patterns.interpreter.command_list import CommandList
... | true | true |
1c18de484313b8da7fc08cecc1495b86ab376638 | 14,200 | py | Python | veles/external/manhole.py | AkshayJainG/veles | 21106f41a8e7e7e74453cd16a5059a0e6b1c315e | [
"Apache-2.0"
] | 1,007 | 2015-07-20T12:01:41.000Z | 2022-03-30T23:08:35.000Z | veles/external/manhole.py | AkshayJainG/veles | 21106f41a8e7e7e74453cd16a5059a0e6b1c315e | [
"Apache-2.0"
] | 52 | 2015-07-21T10:26:24.000Z | 2019-01-24T05:46:43.000Z | veles/external/manhole.py | AkshayJainG/veles | 21106f41a8e7e7e74453cd16a5059a0e6b1c315e | [
"Apache-2.0"
] | 235 | 2015-07-20T09:42:42.000Z | 2021-12-06T18:12:26.000Z | from __future__ import print_function
from logging import getLogger
logger = getLogger(__name__)
import traceback
import socket
import struct
import sys
import os
import atexit
import signal
import errno
import platform
import weakref
try:
import signalfd
except ImportError:
signalfd = None
try:
string = ... | 33.023256 | 118 | 0.593803 | from __future__ import print_function
from logging import getLogger
logger = getLogger(__name__)
import traceback
import socket
import struct
import sys
import os
import atexit
import signal
import errno
import platform
import weakref
try:
import signalfd
except ImportError:
signalfd = None
try:
string = ... | true | true |
1c18de819ea1292562a9e49067055334e327dfaa | 39,267 | py | Python | OpenModal/gui/skeleton.py | MonashSmartStructures/OpenModal | a76a258c420954eab4a8b4ef37b487616c9f6c62 | [
"CNRI-Python"
] | 85 | 2016-12-04T10:34:08.000Z | 2022-03-26T18:03:47.000Z | OpenModal/gui/skeleton.py | MonashSmartStructures/OpenModal | a76a258c420954eab4a8b4ef37b487616c9f6c62 | [
"CNRI-Python"
] | 55 | 2016-12-02T15:01:15.000Z | 2022-01-07T11:10:26.000Z | OpenModal/gui/skeleton.py | gusshmn/OpenModal | a76a258c420954eab4a8b4ef37b487616c9f6c62 | [
"CNRI-Python"
] | 51 | 2016-12-30T16:33:36.000Z | 2021-11-13T11:05:34.000Z |
# Copyright (C) 2014-2017 Matjaž Mršnik, Miha Pirnat, Janko Slavič, Blaž Starc (in alphabetic order)
#
# This file is part of OpenModal.
#
# OpenModal is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version... | 37.397143 | 155 | 0.612321 |
__author__ = 'Matjaz'
import pickle
import sys, time
from string import Template
from PyQt5 import QtCore, QtGui, QtWidgets
import qtawesome as qta
from OpenModal.gui.widgets.welcome import WelcomeWidget
from OpenModal.gui.widgets.geometry import GeometryWidget
from OpenModal.gui.widgets.measurement import Measu... | true | true |
1c18df3b27ab98b28ffc47e2886cf99f91981dfc | 43,680 | py | Python | python/pyspark/ml/regression.py | guancan2014021510/spark | a9b8b655b25f4ed519037faaf7601a3d9842547f | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | python/pyspark/ml/regression.py | guancan2014021510/spark | a9b8b655b25f4ed519037faaf7601a3d9842547f | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | python/pyspark/ml/regression.py | guancan2014021510/spark | a9b8b655b25f4ed519037faaf7601a3d9842547f | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 35.628059 | 100 | 0.625046 |
import warnings
from pyspark import since
from pyspark.ml.param.shared import *
from pyspark.ml.util import *
from pyspark.ml.wrapper import JavaEstimator, JavaModel, JavaCallable
from pyspark.mllib.common import inherit_doc
from pyspark.sql import DataFrame
__all__ = ['AFTSurvivalRegression', 'AFTSurvivalRegressio... | true | true |
1c18e00625d3a9199c34d89ed02ec443fcd1b36b | 6,442 | py | Python | doc/sphinx/source/conf.py | simoll/pocl | 070848d6c7eaf58045db5521b246d309288eea41 | [
"MIT"
] | 1 | 2020-10-20T07:03:22.000Z | 2020-10-20T07:03:22.000Z | doc/sphinx/source/conf.py | FreemanX/pocl-android | 7710ed15d0867dd356b533b49b62309b6e2be11e | [
"MIT"
] | null | null | null | doc/sphinx/source/conf.py | FreemanX/pocl-android | 7710ed15d0867dd356b533b49b62309b6e2be11e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Portable Computing Language (pocl) documentation build configuration file, created by
# sphinx-quickstart on Fri May 3 10:53:18 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# ... | 33.035897 | 101 | 0.726327 |
import sys, os
extensions = ['sphinx.ext.imgmath']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Portable Computing Language (pocl)'
copyright = u'2010-2020 pocl developers'
# |version| and |release|, also used in various other places throughout the
# built documents.... | true | true |
1c18e0f582201f2f113a8253ef49394eb863208b | 1,903 | py | Python | eventmanager/api/serializers.py | ralcabes/EventManager | dd73b2387228b4508d27974a8eeb222d5ffeecdc | [
"MIT"
] | null | null | null | eventmanager/api/serializers.py | ralcabes/EventManager | dd73b2387228b4508d27974a8eeb222d5ffeecdc | [
"MIT"
] | null | null | null | eventmanager/api/serializers.py | ralcabes/EventManager | dd73b2387228b4508d27974a8eeb222d5ffeecdc | [
"MIT"
] | null | null | null | from accounts.models import AccountDetails
from categories.models import Category
from events.models import Comment
from events.models import Event
from events.models import Invite
from tasks.models import Task
from rest_framework import serializers
class EventSerializer(serializers.ModelSerializer):
class Me... | 22.388235 | 78 | 0.535996 | from accounts.models import AccountDetails
from categories.models import Category
from events.models import Comment
from events.models import Event
from events.models import Invite
from tasks.models import Task
from rest_framework import serializers
class EventSerializer(serializers.ModelSerializer):
class Me... | true | true |
1c18e17fb81478fe194c1da17b599b456fdc8dfd | 5,303 | py | Python | script/PostgresDatabase.py | C-VARS/cvars-back-end | 4cd2478c9f29195ba93d04310c8294d051330891 | [
"MIT"
] | null | null | null | script/PostgresDatabase.py | C-VARS/cvars-back-end | 4cd2478c9f29195ba93d04310c8294d051330891 | [
"MIT"
] | 2 | 2021-04-30T20:53:50.000Z | 2021-06-02T00:41:27.000Z | script/PostgresDatabase.py | C-VARS/cvars-back-end | 4cd2478c9f29195ba93d04310c8294d051330891 | [
"MIT"
] | null | null | null | import os
from typing import Dict
from script import PresetInformation
from script.DatabaseInitializer import DatabaseInitializer
from script.DatabaseInterface import DatabaseInterface
import psycopg2
from script.Ports.InvoiceCreator import InvoiceCreator
from script.Ports.InfoRetriever import InfoRetriever
from scr... | 42.766129 | 78 | 0.645295 | import os
from typing import Dict
from script import PresetInformation
from script.DatabaseInitializer import DatabaseInitializer
from script.DatabaseInterface import DatabaseInterface
import psycopg2
from script.Ports.InvoiceCreator import InvoiceCreator
from script.Ports.InfoRetriever import InfoRetriever
from scr... | true | true |
1c18e1e63ff4f7fb49b3cef79485dfb9fbb34c51 | 1,682 | py | Python | fsetools/__init__.py | fsepy/fsetools | 6b6c647912551680109a84d8640b9cfbe7970970 | [
"Apache-2.0"
] | 1 | 2020-02-25T21:47:56.000Z | 2020-02-25T21:47:56.000Z | fsetools/__init__.py | fsepy/fsetools | 6b6c647912551680109a84d8640b9cfbe7970970 | [
"Apache-2.0"
] | 12 | 2020-02-24T10:10:57.000Z | 2020-09-18T11:18:08.000Z | fsetools/__init__.py | fsepy/fsetools | 6b6c647912551680109a84d8640b9cfbe7970970 | [
"Apache-2.0"
] | null | null | null | """
VERSION IDENTIFICATION RULES DOCUMENTED IN PEP 440.
Version scheme
==============
Distributions are identified by a public version identifier which supports all defined version comparison operations
The version scheme is used both to describe the distribution version provided by a particular distribution archive... | 31.735849 | 149 | 0.670036 |
__version__ = "0.0.3"
if __name__ == "__main__":
import re
def is_canonical(version):
return (
re.match(
r"^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$",
version,
... | true | true |
1c18e3626683812a47e9a12a2cc977c15de159f9 | 447 | py | Python | config.py | phondanai/tweet-locator | 8d2878d21563495f48486ddd076422a16955e3c9 | [
"MIT"
] | 1 | 2020-08-24T20:21:23.000Z | 2020-08-24T20:21:23.000Z | config.py | phondanai/tweet-locator | 8d2878d21563495f48486ddd076422a16955e3c9 | [
"MIT"
] | null | null | null | config.py | phondanai/tweet-locator | 8d2878d21563495f48486ddd076422a16955e3c9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
CONSUMER_KEY = os.getenv('CONSUMER_KEY')
CONSUMER_SEC... | 27.9375 | 71 | 0.718121 |
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
CONSUMER_KEY = os.getenv('CONSUMER_KEY')
CONSUMER_SECRET = os.getenv('CONSUME... | true | true |
1c18e456c4d549c010973e41a8414a3989db5bbb | 3,091 | py | Python | samplers/randomPolicySampler.py | jkwang1992/sbp-env | 929a88c30e0056cce55ef22f74bfa218c1e78cc8 | [
"MIT"
] | 5 | 2021-06-14T08:02:49.000Z | 2021-12-26T06:08:49.000Z | samplers/randomPolicySampler.py | jkwang1992/sbp-env | 929a88c30e0056cce55ef22f74bfa218c1e78cc8 | [
"MIT"
] | 7 | 2021-10-01T12:45:50.000Z | 2021-10-14T03:57:05.000Z | samplers/randomPolicySampler.py | soraxas/sbp-env | 929a88c30e0056cce55ef22f74bfa218c1e78cc8 | [
"MIT"
] | 6 | 2021-07-16T07:04:29.000Z | 2021-12-28T11:52:22.000Z | import random
import numpy as np
from overrides import overrides
from randomness import SUPPORTED_RANDOM_METHODS, RandomnessManager
from samplers.baseSampler import Sampler
from utils import planner_registry
class RandomPolicySampler(Sampler):
r"""Uniformly and randomly samples configurations across :math:`d` w... | 31.865979 | 85 | 0.596571 | import random
import numpy as np
from overrides import overrides
from randomness import SUPPORTED_RANDOM_METHODS, RandomnessManager
from samplers.baseSampler import Sampler
from utils import planner_registry
class RandomPolicySampler(Sampler):
@overrides
def __init__(self, random_method: str = "pseudo_rand... | true | true |
1c18e5aa608624b7f5b40167b2549b2031920f7c | 389 | py | Python | onnx_darknet/handlers/frontend/tan.py | minhoolee/onnx-darknet | d0227c305710b740e6b06315d83b021a183bfdaf | [
"Apache-2.0"
] | 6 | 2019-02-26T07:38:01.000Z | 2020-07-08T22:18:22.000Z | onnx_darknet/handlers/frontend/tan.py | minhoolee/onnx-darknet | d0227c305710b740e6b06315d83b021a183bfdaf | [
"Apache-2.0"
] | 1 | 2019-02-26T07:48:26.000Z | 2019-02-26T22:00:22.000Z | onnx_darknet/handlers/frontend/tan.py | minhoolee/onnx-darknet | d0227c305710b740e6b06315d83b021a183bfdaf | [
"Apache-2.0"
] | null | null | null | from onnx_darknet.handlers.frontend_handler import FrontendHandler
from onnx_darknet.handlers.handler import onnx_op
from onnx_darknet.handlers.handler import darknet_op
from .math_mixin import BasicMathMixin
@onnx_op("Tan")
@darknet_op("Tan")
class Tan(BasicMathMixin, FrontendHandler):
@classmethod
def version_... | 27.785714 | 66 | 0.807198 | from onnx_darknet.handlers.frontend_handler import FrontendHandler
from onnx_darknet.handlers.handler import onnx_op
from onnx_darknet.handlers.handler import darknet_op
from .math_mixin import BasicMathMixin
@onnx_op("Tan")
@darknet_op("Tan")
class Tan(BasicMathMixin, FrontendHandler):
@classmethod
def version_... | true | true |
1c18e5ff0341845bfe2f260549c18b8c4795124b | 4,704 | py | Python | accelbyte_py_sdk/api/iam/models/model_role_names_response_v3.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/iam/models/model_role_names_response_v3.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | accelbyte_py_sdk/api/iam/models/model_role_names_response_v3.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# justice-iam-service (5.10.1)
# pylint: disable=dup... | 33.6 | 193 | 0.645408 |
from __future__ import annotations
from typing import Any, Dict, List, Optional, Tuple, Union
from ....core import Model
from ..models.accountcommon_pagination_v3 import AccountcommonPaginationV3
class ModelRoleNamesResponseV3(Model):
data: List[str] ... | true | true |
1c18e60882dcb927421d2edc509ba00ff4805288 | 10,700 | py | Python | src/sentry/options/store.py | withrocks/commonlims | d8a925c917aa26e8205fefb3966a9f49f8f2e2f8 | [
"BSD-3-Clause"
] | 4 | 2019-05-27T13:55:07.000Z | 2021-03-30T07:05:09.000Z | src/sentry/options/store.py | withrocks/commonlims | d8a925c917aa26e8205fefb3966a9f49f8f2e2f8 | [
"BSD-3-Clause"
] | 99 | 2019-05-20T14:16:33.000Z | 2021-01-19T09:25:15.000Z | src/sentry/options/store.py | withrocks/commonlims | d8a925c917aa26e8205fefb3966a9f49f8f2e2f8 | [
"BSD-3-Clause"
] | 1 | 2020-08-10T07:55:40.000Z | 2020-08-10T07:55:40.000Z | """
sentry.options.store
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
import six
from collections import namedtuple
from time import time
from ran... | 34.405145 | 91 | 0.60271 | from __future__ import absolute_import, print_function
import logging
import six
from collections import namedtuple
from time import time
from random import random
from django.db.utils import ProgrammingError, OperationalError
from django.utils import timezone
from django.utils.functional import cached_property
from... | true | true |
1c18e609eeb01284e7be438597cae27cd82ee090 | 10,614 | py | Python | calvin/runtime/north/tests/test_storage.py | josrolgil/exjobbCalvin | 976459eaa50246586360c049b9880d753623d574 | [
"Apache-2.0"
] | 1 | 2016-05-10T22:36:31.000Z | 2016-05-10T22:36:31.000Z | calvin/runtime/north/tests/test_storage.py | josrolgil/exjobbCalvin | 976459eaa50246586360c049b9880d753623d574 | [
"Apache-2.0"
] | null | null | null | calvin/runtime/north/tests/test_storage.py | josrolgil/exjobbCalvin | 976459eaa50246586360c049b9880d753623d574 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | 36.474227 | 110 | 0.639627 |
from calvin.utilities import calvinuuid
from calvin.runtime.north import storage
from calvin.runtime.north import appmanager
from calvin.runtime.south.plugins.async import threads
from calvin.utilities.calvin_callback import CalvinCB
from calvin.tests import TestNode, TestActor, TestPort
import Queue
import pytest
im... | false | true |
1c18e656f99686e229264dc9e78b7b8d855395b9 | 2,369 | py | Python | src/gateway_devices/sarad_gateway_device.py | IvanAdamo/rfc2217-gateway | 843c91e02b40e3a9458e44aab4cdc7a735dabcdd | [
"Apache-2.0"
] | 1 | 2021-03-28T17:04:31.000Z | 2021-03-28T17:04:31.000Z | src/gateway_devices/sarad_gateway_device.py | IvanAdamo/rfc2217-gateway | 843c91e02b40e3a9458e44aab4cdc7a735dabcdd | [
"Apache-2.0"
] | null | null | null | src/gateway_devices/sarad_gateway_device.py | IvanAdamo/rfc2217-gateway | 843c91e02b40e3a9458e44aab4cdc7a735dabcdd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import logging
from gateway_devices.generic_gateway_device import GenericGatewayDevice
from SarI import SaradCluster
logger = logging.getLogger(__name__)
def get_class():
return SaradGatewayDevice
class SaradGatewayDevice(GenericGatewayDevice):
NAME = "SARAD"
ID_MODEL_ID = "6001"... | 36.446154 | 109 | 0.597298 |
import logging
from gateway_devices.generic_gateway_device import GenericGatewayDevice
from SarI import SaradCluster
logger = logging.getLogger(__name__)
def get_class():
return SaradGatewayDevice
class SaradGatewayDevice(GenericGatewayDevice):
NAME = "SARAD"
ID_MODEL_ID = "6001"
ID_VENDOR_ID = "04... | true | true |
1c18e6b1d25e0c19cf9ccb57dc00c52430c9d439 | 34,725 | py | Python | pandas/tests/groupby/test_categorical.py | swt2c/pandas | 70773d952bf52229d7214707ce6d66cee70607cb | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/groupby/test_categorical.py | swt2c/pandas | 70773d952bf52229d7214707ce6d66cee70607cb | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/groupby/test_categorical.py | swt2c/pandas | 70773d952bf52229d7214707ce6d66cee70607cb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from datetime import datetime
import numpy as np
import pytest
from pandas.compat import PY37
import pandas as pd
from pandas import (
Categorical, CategoricalIndex, DataFrame, Index, MultiIndex, Series, qcut)
import pandas.util.testing as tm
from pandas.util.testing import (
assert_e... | 37.139037 | 113 | 0.554384 | from datetime import datetime
import numpy as np
import pytest
from pandas.compat import PY37
import pandas as pd
from pandas import (
Categorical, CategoricalIndex, DataFrame, Index, MultiIndex, Series, qcut)
import pandas.util.testing as tm
from pandas.util.testing import (
assert_equal, assert_frame_equal... | true | true |
1c18e6d41b575dbb7a3bb72f6b3afa06a1ab21b4 | 9,639 | py | Python | tst/test_reporter.py | kangasta/fdbk | 426a04131869ceefd3bd2c80d327b60a3a8e2d7b | [
"MIT"
] | 1 | 2019-05-04T09:18:48.000Z | 2019-05-04T09:18:48.000Z | tst/test_reporter.py | kangasta/fdbk | 426a04131869ceefd3bd2c80d327b60a3a8e2d7b | [
"MIT"
] | 36 | 2018-10-25T13:29:12.000Z | 2021-09-23T22:30:07.000Z | tst/test_reporter.py | kangasta/fdbk | 426a04131869ceefd3bd2c80d327b60a3a8e2d7b | [
"MIT"
] | null | null | null | from datetime import datetime
from random import randrange
from unittest import TestCase
from unittest.mock import Mock, patch
from freezegun import freeze_time
from fdbk import Reporter, DictConnection
from fdbk.reporter import _add, _div, _obj_add, _Data
class TestDataSource:
def __init__(self, pattern, n):
... | 32.345638 | 88 | 0.619255 | from datetime import datetime
from random import randrange
from unittest import TestCase
from unittest.mock import Mock, patch
from freezegun import freeze_time
from fdbk import Reporter, DictConnection
from fdbk.reporter import _add, _div, _obj_add, _Data
class TestDataSource:
def __init__(self, pattern, n):
... | true | true |
1c18e7122a906325e62c9deaeaf7b7f39eca2530 | 12,268 | py | Python | jpeg_parser.py | wolfd/jpeg-svg | 42370757ec98642b57486c7d2fd3fae7df9bc271 | [
"MIT"
] | null | null | null | jpeg_parser.py | wolfd/jpeg-svg | 42370757ec98642b57486c7d2fd3fae7df9bc271 | [
"MIT"
] | null | null | null | jpeg_parser.py | wolfd/jpeg-svg | 42370757ec98642b57486c7d2fd3fae7df9bc271 | [
"MIT"
] | null | null | null | import typing as T
import struct
import enum
import numpy as np
from zigzag import fill_zigzag
from huffman import Huffman
BLOCK_SIDE_PX = 8
BLOCK_SIZE_BYTE = BLOCK_SIDE_PX * BLOCK_SIDE_PX
SOI_EXPECTED = (0xFF, 0xD8)
JFIF_APP0_EXPECTED = (0xFF, 0xE0)
def unpack_from_file(format: str, file_: T.BinaryIO):
return... | 32.714667 | 87 | 0.64061 | import typing as T
import struct
import enum
import numpy as np
from zigzag import fill_zigzag
from huffman import Huffman
BLOCK_SIDE_PX = 8
BLOCK_SIZE_BYTE = BLOCK_SIDE_PX * BLOCK_SIDE_PX
SOI_EXPECTED = (0xFF, 0xD8)
JFIF_APP0_EXPECTED = (0xFF, 0xE0)
def unpack_from_file(format: str, file_: T.BinaryIO):
return... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.