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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0489ff87422767ae6e3fda6508d2768babcc11 | 7,914 | py | Python | bcbio/pipeline/rnaseq.py | arvados/bcbio-nextgen | 2a5cfa8c3a1d540bb2f2e66f51835042195cbc87 | [
"MIT"
] | null | null | null | bcbio/pipeline/rnaseq.py | arvados/bcbio-nextgen | 2a5cfa8c3a1d540bb2f2e66f51835042195cbc87 | [
"MIT"
] | null | null | null | bcbio/pipeline/rnaseq.py | arvados/bcbio-nextgen | 2a5cfa8c3a1d540bb2f2e66f51835042195cbc87 | [
"MIT"
] | null | null | null | import os
from bcbio.rnaseq import (featureCounts, cufflinks, oncofuse, count, dexseq,
express, variation)
from bcbio.ngsalign import bwa, bowtie2
import bcbio.pipeline.datadict as dd
from bcbio.utils import filter_missing
from bcbio.log import logger
def rnaseq_variant_calling(samples, run_p... | 43.966667 | 95 | 0.699646 | import os
from bcbio.rnaseq import (featureCounts, cufflinks, oncofuse, count, dexseq,
express, variation)
from bcbio.ngsalign import bwa, bowtie2
import bcbio.pipeline.datadict as dd
from bcbio.utils import filter_missing
from bcbio.log import logger
def rnaseq_variant_calling(samples, run_p... | true | true |
1c048a1c572d85cdf77fe6de7022af88d7178b64 | 3,122 | py | Python | tests/tests/test_it_anonymous_upload.py | mari8i/drf-file-upload | 83bab708643a9f87bc9a3f41ee95d1b1d74e584d | [
"BSD-3-Clause"
] | 1 | 2021-05-13T04:19:05.000Z | 2021-05-13T04:19:05.000Z | tests/tests/test_it_anonymous_upload.py | mari8i/drf-file-upload | 83bab708643a9f87bc9a3f41ee95d1b1d74e584d | [
"BSD-3-Clause"
] | null | null | null | tests/tests/test_it_anonymous_upload.py | mari8i/drf-file-upload | 83bab708643a9f87bc9a3f41ee95d1b1d74e584d | [
"BSD-3-Clause"
] | null | null | null | import os
import re
from rest_framework import status
from rest_framework.test import APIClient
from drf_file_upload import models
from tests.tests import factory
from tests.tests.base_test import BaseDrfFileUploadTestCase
API_ENDPOINT = "/anonymous-upload/"
class AuthenticatedFileUploadTestCase(BaseDrfFileUploadT... | 40.545455 | 105 | 0.705317 | import os
import re
from rest_framework import status
from rest_framework.test import APIClient
from drf_file_upload import models
from tests.tests import factory
from tests.tests.base_test import BaseDrfFileUploadTestCase
API_ENDPOINT = "/anonymous-upload/"
class AuthenticatedFileUploadTestCase(BaseDrfFileUploadT... | true | true |
1c048caff538122a5df40640f448d7c25d4c7ad9 | 13 | py | Python | example_snippets/multimenus_snippets/NewSnippets/SymPy/Functions/Combinatorial functions/Double factorial.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/NewSnippets/SymPy/Functions/Combinatorial functions/Double factorial.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/NewSnippets/SymPy/Functions/Combinatorial functions/Double factorial.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | 1 | 2021-02-04T04:51:48.000Z | 2021-02-04T04:51:48.000Z | factorial2(n) | 13 | 13 | 0.846154 | factorial2(n) | true | true |
1c048cf48d1aa454b7732106d5370a78d1271d64 | 7,497 | py | Python | lib/dataset/voc/voc_eval.py | akhilpm/SemiWSOD | c7b2e343ededb44f54f7081378e59b30a1903705 | [
"MIT"
] | null | null | null | lib/dataset/voc/voc_eval.py | akhilpm/SemiWSOD | c7b2e343ededb44f54f7081378e59b30a1903705 | [
"MIT"
] | null | null | null | lib/dataset/voc/voc_eval.py | akhilpm/SemiWSOD | c7b2e343ededb44f54f7081378e59b30a1903705 | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Bharath Hariharan
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future__ import pr... | 35.03271 | 78 | 0.519008 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import xml.etree.ElementTree as ET
import os
import re
import pickle
import numpy as np
def parse_rec(filename):
tree = ET.parse(filename)
objects = []
for obj in tree.findall('object'):
o... | true | true |
1c048de4e07ac5fbd77010a6e36652571fcd62ca | 1,318 | py | Python | place/models.py | dolikemc/hosttheway | d3344a1652b09d4cc191386236cebeca9984eb29 | [
"BSD-3-Clause"
] | null | null | null | place/models.py | dolikemc/hosttheway | d3344a1652b09d4cc191386236cebeca9984eb29 | [
"BSD-3-Clause"
] | 1 | 2021-03-10T10:49:07.000Z | 2021-03-10T10:49:07.000Z | place/models.py | dolikemc/hosttheway | d3344a1652b09d4cc191386236cebeca9984eb29 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib.auth.models import User
from django.contrib.gis.db import models
class WorldBorder(models.Model):
# Regular Django fields corresponding to the attributes in the
# world borders shapefile.
name = models.CharField(max_length=50)
area = models.IntegerField()
pop2005 = models.Intege... | 36.611111 | 69 | 0.72003 | from django.contrib.auth.models import User
from django.contrib.gis.db import models
class WorldBorder(models.Model):
name = models.CharField(max_length=50)
area = models.IntegerField()
pop2005 = models.IntegerField('Population 2005')
fips = models.CharField('FIPS Code', max_length=2, null=True... | true | true |
1c048e986221ff0eb80f0c85de3636244105227a | 7,031 | py | Python | PyNSL/PyNSL.py | MKegler/SpeechtACSmodel | f7b747a1a286f2dd239f452184d790e096366de7 | [
"MIT"
] | null | null | null | PyNSL/PyNSL.py | MKegler/SpeechtACSmodel | f7b747a1a286f2dd239f452184d790e096366de7 | [
"MIT"
] | null | null | null | PyNSL/PyNSL.py | MKegler/SpeechtACSmodel | f7b747a1a286f2dd239f452184d790e096366de7 | [
"MIT"
] | null | null | null | '''
Direct Python port of a few functions from NSL toolbox implementing
early stage auditory processing. All credits go to the original authors.
The below implementation has been tested against the original
Matlab code (http://nsl.isr.umd.edu/downloads.html) and yielded identical results.
Implementation: Mikolaj Kegle... | 34.635468 | 107 | 0.558384 |
import numpy as np
import scipy.io as sio
from scipy import signal
import os
import pkg_resources
def sigmoid(y, fac):
if fac > 0:
y = np.exp(-y/fac)
y = 1./(1+y)
elif fac == 0:
y = (y > 0) elif fac == -1:
y = np.max(... | true | true |
1c048ee4464214e2fc85e22919ad6850412f32c5 | 956 | py | Python | iu_mongo/__init__.py | intelligenceunion/mongo-driver | 02bbc6839c8264d4b06b053e8cc83d42147ede17 | [
"MIT"
] | null | null | null | iu_mongo/__init__.py | intelligenceunion/mongo-driver | 02bbc6839c8264d4b06b053e8cc83d42147ede17 | [
"MIT"
] | null | null | null | iu_mongo/__init__.py | intelligenceunion/mongo-driver | 02bbc6839c8264d4b06b053e8cc83d42147ede17 | [
"MIT"
] | 1 | 2019-06-21T17:49:08.000Z | 2019-06-21T17:49:08.000Z | from iu_mongo.slave_ok_setting import *
from iu_mongo.document import *
from iu_mongo.fields import *
from iu_mongo.connection import *
from iu_mongo.errors import *
from iu_mongo.index import *
from iu_mongo.session import *
import iu_mongo.slave_ok_setting as slave_ok_setting
import iu_mongo.document as document
impo... | 28.117647 | 65 | 0.721757 | from iu_mongo.slave_ok_setting import *
from iu_mongo.document import *
from iu_mongo.fields import *
from iu_mongo.connection import *
from iu_mongo.errors import *
from iu_mongo.index import *
from iu_mongo.session import *
import iu_mongo.slave_ok_setting as slave_ok_setting
import iu_mongo.document as document
impo... | true | true |
1c048fb77cdba084fcdac4820460f9d3428bd9d9 | 1,248 | py | Python | tests_shape_example.py | adamchainz/trycast | 6b3ee08d7dcaf3872ceb3b39db12f110a4e5a8a6 | [
"MIT"
] | null | null | null | tests_shape_example.py | adamchainz/trycast | 6b3ee08d7dcaf3872ceb3b39db12f110a4e5a8a6 | [
"MIT"
] | null | null | null | tests_shape_example.py | adamchainz/trycast | 6b3ee08d7dcaf3872ceb3b39db12f110a4e5a8a6 | [
"MIT"
] | null | null | null | import sys
from trycast import trycast
from typing import cast, Dict, List, Optional, Union
# Literal
if sys.version_info >= (3, 8):
from typing import Literal # Python 3.8+
else:
from typing_extensions import Literal # Python 3.5+
# TypedDict
if sys.version_info >= (3, 8):
from typing import TypedDict ... | 24.96 | 63 | 0.692308 | import sys
from trycast import trycast
from typing import cast, Dict, List, Optional, Union
if sys.version_info >= (3, 8):
from typing import Literal else:
from typing_extensions import Literal
if sys.version_info >= (3, 8):
from typing import TypedDict else:
from typing_extensions import TypedDict... | true | true |
1c0490823d41f35ec448d8e668728d7865a139b8 | 927 | py | Python | examples/tcp/client_subhandled.py | greenaddress/txjsonrpc | 272d44db43d36645ba981c6e7fa73e33c1fbb7d5 | [
"MIT"
] | null | null | null | examples/tcp/client_subhandled.py | greenaddress/txjsonrpc | 272d44db43d36645ba981c6e7fa73e33c1fbb7d5 | [
"MIT"
] | 1 | 2019-10-16T14:00:25.000Z | 2019-11-11T16:23:20.000Z | examples/tcp/client_subhandled.py | greenaddress/txjsonrpc | 272d44db43d36645ba981c6e7fa73e33c1fbb7d5 | [
"MIT"
] | 2 | 2017-05-15T06:03:27.000Z | 2019-07-21T09:04:24.000Z | from __future__ import absolute_import
from __future__ import print_function
import os
import sys
sys.path.insert(0, os.getcwd())
from twisted.internet import reactor
from twisted.internet import defer
from txjsonrpc.netstring.jsonrpc import Proxy
def printValue(value):
print("Result: %s" % str(value))
def pr... | 19.3125 | 45 | 0.7411 | from __future__ import absolute_import
from __future__ import print_function
import os
import sys
sys.path.insert(0, os.getcwd())
from twisted.internet import reactor
from twisted.internet import defer
from txjsonrpc.netstring.jsonrpc import Proxy
def printValue(value):
print("Result: %s" % str(value))
def pr... | true | true |
1c04934c8fa8c3ea6cd0179bd7ac798d4d8c80a4 | 2,455 | py | Python | 05_howler/test.py | sidsid14/tiny_python_projects | 5f98d6416388adbb77f8174df0cec5180a0a4c0c | [
"MIT"
] | 742 | 2020-01-30T12:08:38.000Z | 2022-03-28T00:17:12.000Z | 05_howler/test.py | sidsid14/tiny_python_projects | 5f98d6416388adbb77f8174df0cec5180a0a4c0c | [
"MIT"
] | 15 | 2020-08-08T07:09:51.000Z | 2022-02-15T19:02:10.000Z | 05_howler/test.py | sidsid14/tiny_python_projects | 5f98d6416388adbb77f8174df0cec5180a0a4c0c | [
"MIT"
] | 1,472 | 2020-01-21T01:50:59.000Z | 2022-03-31T08:29:33.000Z | #!/usr/bin/env python3
"""tests for howler.py"""
import os
import re
import random
import string
from subprocess import getstatusoutput, getoutput
prg = './howler.py'
# --------------------------------------------------
def random_string():
"""generate a random string"""
k = random.randint(5, 10)
retur... | 26.397849 | 77 | 0.481874 |
import os
import re
import random
import string
from subprocess import getstatusoutput, getoutput
prg = './howler.py'
def random_string():
k = random.randint(5, 10)
return ''.join(random.choices(string.ascii_letters + string.digits, k=k))
def out_flag():
return '-o' if random.randint(0, 1) else '--o... | true | true |
1c04940f621224d867680b584fc141f40af9cce4 | 6,604 | py | Python | tests/python_client/scale/test_index_node_scale.py | zoujialong9012/milvus | 4e956ee10c9725c1ec85e88aadda170fb0edbc18 | [
"Apache-2.0"
] | 2 | 2021-09-05T15:00:49.000Z | 2022-01-05T06:42:23.000Z | tests/python_client/scale/test_index_node_scale.py | zoujialong9012/milvus | 4e956ee10c9725c1ec85e88aadda170fb0edbc18 | [
"Apache-2.0"
] | null | null | null | tests/python_client/scale/test_index_node_scale.py | zoujialong9012/milvus | 4e956ee10c9725c1ec85e88aadda170fb0edbc18 | [
"Apache-2.0"
] | 1 | 2021-09-05T15:03:52.000Z | 2021-09-05T15:03:52.000Z | import datetime
import time
import pytest
from pymilvus import connections
from base.collection_wrapper import ApiCollectionWrapper
from common.common_type import CaseLabel
from customize.milvus_operator import MilvusOperator
from scale import constants
from common import common_func as cf
from common import common_t... | 39.076923 | 115 | 0.639764 | import datetime
import time
import pytest
from pymilvus import connections
from base.collection_wrapper import ApiCollectionWrapper
from common.common_type import CaseLabel
from customize.milvus_operator import MilvusOperator
from scale import constants
from common import common_func as cf
from common import common_t... | true | true |
1c049420347c79fa10bfee3733a7b5d289fbfb6e | 14,479 | py | Python | fkie_node_manager/src/fkie_node_manager/select_dialog.py | JOiiNT-LAB/multimaster_fkie | 8d77d75f57da16ad81c01069e6f616e8d7121ff7 | [
"BSD-3-Clause"
] | 194 | 2015-01-21T12:46:42.000Z | 2022-03-29T08:22:22.000Z | fkie_node_manager/src/fkie_node_manager/select_dialog.py | JOiiNT-LAB/multimaster_fkie | 8d77d75f57da16ad81c01069e6f616e8d7121ff7 | [
"BSD-3-Clause"
] | 146 | 2015-01-13T23:02:24.000Z | 2022-03-23T05:54:02.000Z | fkie_node_manager/src/fkie_node_manager/select_dialog.py | JOiiNT-LAB/multimaster_fkie | 8d77d75f57da16ad81c01069e6f616e8d7121ff7 | [
"BSD-3-Clause"
] | 103 | 2015-02-08T23:20:02.000Z | 2022-03-27T12:45:48.000Z | # Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code mus... | 41.726225 | 269 | 0.650597 |
from python_qt_binding.QtCore import Qt, Signal, QPoint, QSize
try:
from python_qt_binding.QtGui import QCheckBox, QDialog, QFrame, QDialogButtonBox, QLabel, QLineEdit, QScrollArea, QWidget
from python_qt_binding.QtGui import QFormLayout, QHBoxLayout, QVBoxLayout, QSizePolicy, QSpacerItem
except Exception:
... | true | true |
1c0494301a0785fff464f396607c191c22f3a723 | 5,956 | py | Python | halalar/api/models.py | jawaidss/halalar-web | abb5db6fa83aba7b7a280fcff1b880f36c0b4548 | [
"MIT"
] | 1 | 2015-11-09T22:09:43.000Z | 2015-11-09T22:09:43.000Z | halalar/api/models.py | jawaidss/halalar-web | abb5db6fa83aba7b7a280fcff1b880f36c0b4548 | [
"MIT"
] | null | null | null | halalar/api/models.py | jawaidss/halalar-web | abb5db6fa83aba7b7a280fcff1b880f36c0b4548 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from django_countries.fields import CountryField
import hashlib
import mailchimp
import os
import random
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.humanize.templatetags.humanize import naturaltime
from django.contrib.sites.... | 33.840909 | 124 | 0.595534 | from datetime import datetime, timedelta
from django_countries.fields import CountryField
import hashlib
import mailchimp
import os
import random
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.humanize.templatetags.humanize import naturaltime
from django.contrib.sites.... | true | true |
1c0494b834e2907155777afcb164ddc8d986a8e0 | 1,650 | py | Python | kingfisher_scrapy/spiders/mexico_quien_es_quien_records.py | open-contracting/kingfisher-scrape | 88b818a97d9d28b1ab241f5a6459b324b39a566b | [
"BSD-3-Clause"
] | 1 | 2019-05-19T11:50:12.000Z | 2019-05-19T11:50:12.000Z | kingfisher_scrapy/spiders/mexico_quien_es_quien_records.py | open-contracting/kingfisher-scrape | 88b818a97d9d28b1ab241f5a6459b324b39a566b | [
"BSD-3-Clause"
] | 234 | 2019-01-15T16:30:24.000Z | 2020-04-27T22:01:10.000Z | kingfisher_scrapy/spiders/mexico_quien_es_quien_records.py | open-contracting/kingfisher-scrape | 88b818a97d9d28b1ab241f5a6459b324b39a566b | [
"BSD-3-Clause"
] | 4 | 2019-02-01T09:11:17.000Z | 2019-07-12T10:52:39.000Z | import json
from kingfisher_scrapy.spiders.mexico_quien_es_quien_base import MexicoQuienEsQuienBase
from kingfisher_scrapy.util import handle_http_error
class MexicoQuienEsQuienRecords(MexicoQuienEsQuienBase):
"""
Domain
QuiénEsQuién.Wiki
Caveats
The 'record' endpoint returns a 'data' array w... | 40.243902 | 118 | 0.711515 | import json
from kingfisher_scrapy.spiders.mexico_quien_es_quien_base import MexicoQuienEsQuienBase
from kingfisher_scrapy.util import handle_http_error
class MexicoQuienEsQuienRecords(MexicoQuienEsQuienBase):
name = 'mexico_quien_es_quien_records'
data_type = 'record_package'
base_url = 'https... | true | true |
1c0495d68f7b60afd1d737b34dbb37108b0c2ed2 | 20,486 | py | Python | localper_clustering_random_graphs.py | minghao92/LocalPer | c940dce63ff2583f836d4718ce43023fad310c05 | [
"MIT"
] | null | null | null | localper_clustering_random_graphs.py | minghao92/LocalPer | c940dce63ff2583f836d4718ce43023fad310c05 | [
"MIT"
] | null | null | null | localper_clustering_random_graphs.py | minghao92/LocalPer | c940dce63ff2583f836d4718ce43023fad310c05 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import networkx as nx
import numpy as np
import math
import snap
import random
import os
import argparse
import matplotlib.pyplot as plt
import scipy.spatial.distance as ssd
from scipy.cluster.hierarchy import dendrogram, linkage
from sklearn.cluster import KMeans, Mi... | 40.972 | 233 | 0.552084 |
import networkx as nx
import numpy as np
import math
import snap
import random
import os
import argparse
import matplotlib.pyplot as plt
import scipy.spatial.distance as ssd
from scipy.cluster.hierarchy import dendrogram, linkage
from sklearn.cluster import KMeans, MiniBatchKMeans
from utils import dexPer_of_all_... | true | true |
1c049696516248dc6bfe5fafddd1ac0caa533cfc | 10,344 | py | Python | channel-wise-position-encoding/models/vgg.py | islamamirul/PermuteNet | 842591892d5b3af0e175a99b21c8e4e7cd7bd94b | [
"MIT"
] | 26 | 2021-08-19T02:37:26.000Z | 2022-03-14T06:54:30.000Z | channel-wise-position-encoding/models/vgg.py | islamamirul/PermuteNet | 842591892d5b3af0e175a99b21c8e4e7cd7bd94b | [
"MIT"
] | 1 | 2022-03-15T07:40:54.000Z | 2022-03-15T07:40:54.000Z | channel-wise-position-encoding/models/vgg.py | islamamirul/PermuteNet | 842591892d5b3af0e175a99b21c8e4e7cd7bd94b | [
"MIT"
] | null | null | null | '''VGG11/13/16/19 in Pytorch.'''
import torch
import torch.nn as nn
from collections import OrderedDict
import torch.nn.functional as F
cfg = {
'VGG5': [32, 'M', 64, 'M', 128, 'M', 256],
'VGG11': [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'],
'VGG13': [64, 64, 'M', 128, 128, 'M', 256, 2... | 34.48 | 117 | 0.5436 | import torch
import torch.nn as nn
from collections import OrderedDict
import torch.nn.functional as F
cfg = {
'VGG5': [32, 'M', 64, 'M', 128, 'M', 256],
'VGG11': [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'],
'VGG13': [64, 64, 'M', 128, 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512,... | true | true |
1c04974e854983de3f7098b87addc03040f427f9 | 909 | py | Python | tests/mpd/protocol/test_channels.py | tamland/mopidy | 7d5117c299ec33b66b67b906a9971bcbc77c3133 | [
"Apache-2.0"
] | 1 | 2018-05-12T21:28:49.000Z | 2018-05-12T21:28:49.000Z | tests/mpd/protocol/test_channels.py | tamland/mopidy | 7d5117c299ec33b66b67b906a9971bcbc77c3133 | [
"Apache-2.0"
] | null | null | null | tests/mpd/protocol/test_channels.py | tamland/mopidy | 7d5117c299ec33b66b67b906a9971bcbc77c3133 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, unicode_literals
from tests.mpd import protocol
class ChannelsHandlerTest(protocol.BaseTestCase):
def test_subscribe(self):
self.sendRequest('subscribe "topic"')
self.assertEqualResponse('ACK [0@0] {subscribe} Not implemented')
def test_unsubscribe(sel... | 34.961538 | 76 | 0.706271 | from __future__ import absolute_import, unicode_literals
from tests.mpd import protocol
class ChannelsHandlerTest(protocol.BaseTestCase):
def test_subscribe(self):
self.sendRequest('subscribe "topic"')
self.assertEqualResponse('ACK [0@0] {subscribe} Not implemented')
def test_unsubscribe(sel... | true | true |
1c049827d732d62955840904c86f2b77b3290ddd | 5,114 | py | Python | oom/oom.py | ashutosh-arrcus/oom-1 | c87da000b34047daa4c876f36dde2c44453d44ad | [
"MIT"
] | 1 | 2019-12-30T16:12:19.000Z | 2019-12-30T16:12:19.000Z | oom/oom.py | ashutosh-arrcus/oom-1 | c87da000b34047daa4c876f36dde2c44453d44ad | [
"MIT"
] | null | null | null | oom/oom.py | ashutosh-arrcus/oom-1 | c87da000b34047daa4c876f36dde2c44453d44ad | [
"MIT"
] | null | null | null | # /////////////////////////////////////////////////////////////////////
#
# oom.py : Provides the Northbound API, hides the implementation in
# oomlib.py decode.py and the module type definitions
#
# Copyright 2015 Finisar Inc.
#
# Author: Don Bollinger don@thebollingers.org
#
# ///////////////////////////////////... | 33.207792 | 79 | 0.713923 |
import oomlib
from oomlib import print_block_hex
from decode import get_string
def oom_get_port(n):
port = oomlib.oom_get_port(n)
return (port)
def oom_get_portlist():
port_list = oomlib.oom_get_portlist()
return(port_list)
def oom_get_keyvalue(port, key):
return oomlib.oom_get_keyvalue(por... | true | true |
1c04989aaf54fec76259519556dbbbe83d77ba96 | 24,271 | py | Python | tools/management/commands/build_bias_data_main_same_family.py | AlexanderHauser/protwis | 4e84bf99aeefe3874bd671a5d8d0714032dcadaf | [
"Apache-2.0"
] | null | null | null | tools/management/commands/build_bias_data_main_same_family.py | AlexanderHauser/protwis | 4e84bf99aeefe3874bd671a5d8d0714032dcadaf | [
"Apache-2.0"
] | null | null | null | tools/management/commands/build_bias_data_main_same_family.py | AlexanderHauser/protwis | 4e84bf99aeefe3874bd671a5d8d0714032dcadaf | [
"Apache-2.0"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.db import connection
from django.db import IntegrityError
from django.utils.text import slugify
from django.http import HttpResponse, JsonResponse
from build.management.commands.base_build import Command as B... | 42.730634 | 205 | 0.504141 | from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.db import connection
from django.db import IntegrityError
from django.utils.text import slugify
from django.http import HttpResponse, JsonResponse
from build.management.commands.base_build import Command as B... | true | true |
1c049b3dbf4f90b04262a5b596017fd7805420b9 | 4,156 | py | Python | pyAitu/dispatcher/webhook.py | btsdigital/pyAitu | 16b44a018e618e56416d0ae9605d648297268e26 | [
"Apache-2.0"
] | 11 | 2019-09-26T05:09:20.000Z | 2021-05-20T10:45:28.000Z | pyAitu/dispatcher/webhook.py | btsdigital/pyAitu | 16b44a018e618e56416d0ae9605d648297268e26 | [
"Apache-2.0"
] | 8 | 2019-10-08T13:41:09.000Z | 2020-06-25T11:35:56.000Z | pyAitu/dispatcher/webhook.py | btsdigital/pyAitu | 16b44a018e618e56416d0ae9605d648297268e26 | [
"Apache-2.0"
] | 4 | 2020-02-18T09:02:37.000Z | 2020-11-25T06:11:05.000Z | from aiohttp import web
import asyncio
import asyncio.tasks
import datetime
import functools
import logging
import itertools
import typing
import json
from ..models import Update
from ..utils import helper
DEFAULT_WEB_PATH = '/webhook'
DEFAULT_ROUTE_NAME = 'webhook_handler'
BOT_DISPATCHER_KEY = 'BOT_DISPATCHER'
RESP... | 24.738095 | 116 | 0.626083 | from aiohttp import web
import asyncio
import asyncio.tasks
import datetime
import functools
import logging
import itertools
import typing
import json
from ..models import Update
from ..utils import helper
DEFAULT_WEB_PATH = '/webhook'
DEFAULT_ROUTE_NAME = 'webhook_handler'
BOT_DISPATCHER_KEY = 'BOT_DISPATCHER'
RESP... | true | true |
1c049bb39855a981ff10ebc4956516876e9aebd3 | 6,459 | py | Python | sdk/python/pulumi_aws/ec2/get_local_gateway_route_table.py | jen20/pulumi-aws | 172e00c642adc03238f89cc9c5a16b914a77c2b1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ec2/get_local_gateway_route_table.py | jen20/pulumi-aws | 172e00c642adc03238f89cc9c5a16b914a77c2b1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ec2/get_local_gateway_route_table.py | jen20/pulumi-aws | 172e00c642adc03238f89cc9c5a16b914a77c2b1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 41.403846 | 162 | 0.687413 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities, _tables
from . import outputs
from ._inputs import *
__all__ = [
'GetLocalGatewayRouteTableResult',
'AwaitableGetLocalGatewayRouteTableResult',
'get_local_gat... | true | true |
1c049c1c74cc4800a30ec4eb30de9a9346f6f9ae | 7,288 | py | Python | xcube/core/gridmapping/helpers.py | dcs4cop/xcube | c615df539d286d3adbd588886659602487bf5efa | [
"MIT"
] | 97 | 2018-06-26T13:02:55.000Z | 2022-03-26T21:03:13.000Z | xcube/core/gridmapping/helpers.py | dcs4cop/xcube | c615df539d286d3adbd588886659602487bf5efa | [
"MIT"
] | 524 | 2018-11-09T12:00:08.000Z | 2022-03-31T17:00:13.000Z | xcube/core/gridmapping/helpers.py | dcs4cop/xcube | c615df539d286d3adbd588886659602487bf5efa | [
"MIT"
] | 15 | 2019-07-09T08:46:03.000Z | 2022-02-07T18:47:34.000Z | # The MIT License (MIT)
# Copyright (c) 2021 by the xcube development team and contributors
#
# 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... | 33.897674 | 81 | 0.646679 |
import math
from fractions import Fraction
from typing import Any
from typing import Tuple, Optional, Union
import affine
import dask.array as da
import numpy as np
import pyproj.crs
import xarray as xr
from xcube.util.assertions import assert_given
from xcube.util.assertions import assert_instance
from xcube.util.a... | true | true |
1c049c7c42d12fef16d327f02604a05faf45abf4 | 23,807 | py | Python | passbase/api/identity_api.py | passbase/passbase-python | 9d5b9cf21b38c2a50fe3755084ef8291d9e2d4d9 | [
"MIT"
] | 8 | 2020-09-09T14:30:46.000Z | 2020-10-19T14:09:00.000Z | passbase/api/identity_api.py | passbase/passbase-python | 9d5b9cf21b38c2a50fe3755084ef8291d9e2d4d9 | [
"MIT"
] | null | null | null | passbase/api/identity_api.py | passbase/passbase-python | 9d5b9cf21b38c2a50fe3755084ef8291d9e2d4d9 | [
"MIT"
] | 1 | 2021-04-23T21:05:19.000Z | 2021-04-23T21:05:19.000Z | # coding: utf-8
"""
Verification API
# Introduction <span class=\"subtext\"> Welcome to the Passbase Verifications API docs. This documentation will help you understand our models and the Verification API with its endpoints. Based on this you can build your own system (i.e. verification) and hook it up to Pa... | 44.005545 | 2,289 | 0.622968 |
from __future__ import absolute_import
import re
import six
from passbase.api_client import ApiClient
class IdentityApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def get_identity_by_id(self, id... | true | true |
1c049d74a9269f33838d4fd58478280e7537e651 | 415 | py | Python | cbsyst/test_data/Orr2015/plot_CO2SYS_comparison.py | douglascoenen/cbsyst | 79b9a1b549d598c10739129afecea4e0269020c8 | [
"MIT"
] | 20 | 2017-06-25T15:21:13.000Z | 2022-02-09T19:25:47.000Z | cbsyst/test_data/Orr2015/plot_CO2SYS_comparison.py | douglascoenen/cbsyst | 79b9a1b549d598c10739129afecea4e0269020c8 | [
"MIT"
] | 22 | 2017-06-10T16:41:47.000Z | 2021-06-03T20:27:48.000Z | cbsyst/test_data/Orr2015/plot_CO2SYS_comparison.py | douglascoenen/cbsyst | 79b9a1b549d598c10739129afecea4e0269020c8 | [
"MIT"
] | 15 | 2017-07-04T02:19:15.000Z | 2021-12-11T08:59:03.000Z | """
TODO: Script to compare CO2SYS.m output to cbsyst output.
Comparison similar to Orr et al (2015)
Parameters
----------
raw_data : str
Path to GLODAP-WOA comparison data.
co2sys_data : str
Path to output from CO2SYS.m
output_dir : str
Output directory for plots
Returns
-------
Prints a range of statist... | 21.842105 | 57 | 0.727711 | true | true | |
1c049e7b0635715dd63abcec09e6f30bb91fbb1d | 2,938 | py | Python | accounts/migrations/0001_initial.py | tomatsue/django-azuread-oidc | 17c53d585ff8e707d73b5f3e4c7bf1ae980dd3df | [
"MIT"
] | null | null | null | accounts/migrations/0001_initial.py | tomatsue/django-azuread-oidc | 17c53d585ff8e707d73b5f3e4c7bf1ae980dd3df | [
"MIT"
] | null | null | null | accounts/migrations/0001_initial.py | tomatsue/django-azuread-oidc | 17c53d585ff8e707d73b5f3e4c7bf1ae980dd3df | [
"MIT"
] | null | null | null | # Generated by Django 3.0 on 2019-12-15 17:30
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'... | 63.869565 | 329 | 0.660994 |
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migration... | true | true |
1c049e97e016f4ddce718291e722748556b02e3a | 3,858 | py | Python | app/hello_django/settings.py | MikePia/django-ecs-terraform-1 | 93f3fb3f00e7b5deac564e243551eb1c9eddd874 | [
"MIT"
] | null | null | null | app/hello_django/settings.py | MikePia/django-ecs-terraform-1 | 93f3fb3f00e7b5deac564e243551eb1c9eddd874 | [
"MIT"
] | null | null | null | app/hello_django/settings.py | MikePia/django-ecs-terraform-1 | 93f3fb3f00e7b5deac564e243551eb1c9eddd874 | [
"MIT"
] | null | null | null | """
Django settings for hello_django project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import ... | 27.169014 | 91 | 0.682478 |
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-l=!!a-n*p&ab!ig2g!35o6m570c_)77c0o2+5ea^g^xi@0d(r8'
DEBUG = False
ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS', '').split()
# ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'd... | true | true |
1c049ec3c70cdef2da440ff04246a8ed7a5d2811 | 7,816 | py | Python | scripts/extract_features_for_merlin.py | Rijksmuseum-Voice-Inference/voice-to-voice-translation | bbdeb3fd4dc49311a735b59a580a33996ea6bbd3 | [
"MIT"
] | null | null | null | scripts/extract_features_for_merlin.py | Rijksmuseum-Voice-Inference/voice-to-voice-translation | bbdeb3fd4dc49311a735b59a580a33996ea6bbd3 | [
"MIT"
] | null | null | null | scripts/extract_features_for_merlin.py | Rijksmuseum-Voice-Inference/voice-to-voice-translation | bbdeb3fd4dc49311a735b59a580a33996ea6bbd3 | [
"MIT"
] | null | null | null | import os
import sys
import shutil
import glob
import time
import multiprocessing as mp
import numpy as np
import wave
if len(sys.argv)!=5:
print("Usage: ")
print("python extract_features_for_merlin.py <path_to_merlin_dir> <path_to_wav_dir> <path_to_feat_dir> <sampling rate>")
sys.exit(1)
# top merlin dir... | 32.032787 | 151 | 0.590072 | import os
import sys
import shutil
import glob
import time
import multiprocessing as mp
import numpy as np
import wave
if len(sys.argv)!=5:
print("Usage: ")
print("python extract_features_for_merlin.py <path_to_merlin_dir> <path_to_wav_dir> <path_to_feat_dir> <sampling rate>")
sys.exit(1)
merlin_dir = sys... | true | true |
1c04a0131979aa4a43f9d5ed9b04f0bf3dec6fdc | 539 | py | Python | calculator/testLayouts/QHBoxLayout.py | Blackmagicknight/chocobars | cf14d6e55e49042dc70b885cc0507f18799987e3 | [
"MIT"
] | 2 | 2020-11-19T14:21:08.000Z | 2020-12-01T08:34:16.000Z | calculator/testLayouts/QHBoxLayout.py | Blackmagicknight/chocobars | cf14d6e55e49042dc70b885cc0507f18799987e3 | [
"MIT"
] | 1 | 2020-11-24T13:55:23.000Z | 2020-11-26T06:48:42.000Z | calculator/testLayouts/QHBoxLayout.py | Blackmagicknight/chocobars | cf14d6e55e49042dc70b885cc0507f18799987e3 | [
"MIT"
] | 1 | 2020-12-01T08:32:52.000Z | 2020-12-01T08:32:52.000Z | import sys
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QHBoxLayout
from PyQt5.QtWidgets import QPushButton
from PyQt5.QtWidgets import QWidget
app = QApplication(sys.argv)
window = QWidget()
window.setWindowTitle('QHBoxLayout')
layout = QHBoxLayout() # set the layout variable
layout.addWidget... | 29.944444 | 64 | 0.801484 | import sys
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QHBoxLayout
from PyQt5.QtWidgets import QPushButton
from PyQt5.QtWidgets import QWidget
app = QApplication(sys.argv)
window = QWidget()
window.setWindowTitle('QHBoxLayout')
layout = QHBoxLayout() layout.addWidget(QPushButton('Left')) layo... | true | true |
1c04a01d146d67b327e0d0a0bc39659fc8291448 | 4,266 | py | Python | allennlp/data/dataset_readers/interleaving_dataset_reader.py | tianjianjiang/allennlp | 0839f5c263911ec5ff04a2ebe575493c7e0436ef | [
"Apache-2.0"
] | 2 | 2019-12-03T20:04:56.000Z | 2021-03-29T10:38:06.000Z | allennlp/data/dataset_readers/interleaving_dataset_reader.py | tianjianjiang/allennlp | 0839f5c263911ec5ff04a2ebe575493c7e0436ef | [
"Apache-2.0"
] | null | null | null | allennlp/data/dataset_readers/interleaving_dataset_reader.py | tianjianjiang/allennlp | 0839f5c263911ec5ff04a2ebe575493c7e0436ef | [
"Apache-2.0"
] | 2 | 2019-12-04T16:55:13.000Z | 2019-12-06T18:47:15.000Z | from typing import Dict, Iterable
import json
from allennlp.common.checks import ConfigurationError
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.data.fields import MetadataField
from allennlp.data.instance import Instance
_VALID_SCHEMES = {"round_robin", "all_at_once"}
@Datas... | 42.237624 | 95 | 0.658931 | from typing import Dict, Iterable
import json
from allennlp.common.checks import ConfigurationError
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.data.fields import MetadataField
from allennlp.data.instance import Instance
_VALID_SCHEMES = {"round_robin", "all_at_once"}
@Datas... | true | true |
1c04a05c69bbbb6037c00e1980ff3dce9201253f | 13,062 | py | Python | GA_Revenue.py | ankitjain0101/Google-Store-Customer-Profiling | 627017c8dae8c3e7d643fdac79b0fba42ac5ffc2 | [
"MIT"
] | null | null | null | GA_Revenue.py | ankitjain0101/Google-Store-Customer-Profiling | 627017c8dae8c3e7d643fdac79b0fba42ac5ffc2 | [
"MIT"
] | null | null | null | GA_Revenue.py | ankitjain0101/Google-Store-Customer-Profiling | 627017c8dae8c3e7d643fdac79b0fba42ac5ffc2 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import json
import collections
from sklearn.preprocessing import LabelEncoder
from lightgbm.sklearn import LGBMRegressor
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_absolute_er... | 43.54 | 200 | 0.688945 | import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import json
import collections
from sklearn.preprocessing import LabelEncoder
from lightgbm.sklearn import LGBMRegressor
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_absolute_er... | true | true |
1c04a16a2ae80b393271b45fc664c57b8e344d3e | 406 | py | Python | twoSum.py | gvalleru/interview_q_py3 | 5ca71ec603610a4dc7baeb9c429b852d97ae3cb9 | [
"Apache-2.0"
] | null | null | null | twoSum.py | gvalleru/interview_q_py3 | 5ca71ec603610a4dc7baeb9c429b852d97ae3cb9 | [
"Apache-2.0"
] | null | null | null | twoSum.py | gvalleru/interview_q_py3 | 5ca71ec603610a4dc7baeb9c429b852d97ae3cb9 | [
"Apache-2.0"
] | null | null | null | class Solution(object):
def twoSum(self, nums, target):
if len(nums) <= 1:
return False
buff_dict = {}
print(nums)
for i in range(len(nums)):
if nums[i] in buff_dict:
print(buff_dict)
print([buff_dict[nums[i]], i])
e... | 29 | 47 | 0.46798 | class Solution(object):
def twoSum(self, nums, target):
if len(nums) <= 1:
return False
buff_dict = {}
print(nums)
for i in range(len(nums)):
if nums[i] in buff_dict:
print(buff_dict)
print([buff_dict[nums[i]], i])
e... | true | true |
1c04a27420fa92b9b91c48e46cb14ede113f502e | 921 | py | Python | tests/test_objs.py | thedyrn/aio-vkbot | 7f6187eafb5fdc9dab8fcc36172a273fad6ce1ab | [
"MIT"
] | 2 | 2020-02-06T18:06:56.000Z | 2021-02-20T23:03:09.000Z | tests/test_objs.py | thedyrn/aio-vkbot | 7f6187eafb5fdc9dab8fcc36172a273fad6ce1ab | [
"MIT"
] | null | null | null | tests/test_objs.py | thedyrn/aio-vkbot | 7f6187eafb5fdc9dab8fcc36172a273fad6ce1ab | [
"MIT"
] | null | null | null | from aiobot import Message, Update, VkEventType
import pytest
@pytest.fixture
def msg_obj(raw_new_message_update):
message = raw_new_message_update['object']['message']
msg_obj = Message(date=message['date'], from_id=message['from_id'], msg_id=message['id'],
peer_id=message['peer_id'], t... | 36.84 | 95 | 0.714441 | from aiobot import Message, Update, VkEventType
import pytest
@pytest.fixture
def msg_obj(raw_new_message_update):
message = raw_new_message_update['object']['message']
msg_obj = Message(date=message['date'], from_id=message['from_id'], msg_id=message['id'],
peer_id=message['peer_id'], t... | true | true |
1c04a2e6ef20f1d69d67c22d92d2758767fbfa6e | 4,045 | py | Python | nPYc/utilities/normalisation/_probabilisticQuotientNormaliser.py | ghaggart/nPYc-Toolbox | d0160b476581fbd695f3f5f0303048466ed95864 | [
"MIT"
] | null | null | null | nPYc/utilities/normalisation/_probabilisticQuotientNormaliser.py | ghaggart/nPYc-Toolbox | d0160b476581fbd695f3f5f0303048466ed95864 | [
"MIT"
] | null | null | null | nPYc/utilities/normalisation/_probabilisticQuotientNormaliser.py | ghaggart/nPYc-Toolbox | d0160b476581fbd695f3f5f0303048466ed95864 | [
"MIT"
] | null | null | null | import numpy
from hashlib import sha1
from ._normaliserABC import Normaliser
class ProbabilisticQuotientNormaliser(Normaliser):
"""
Normalisation object which performs Probabilistic Quotient normalisation (Dieterle *et al* Analytical Chemistry, 78(13):4281 – 90, 2006)
:param reference: Source of the reference pro... | 29.962963 | 232 | 0.730284 | import numpy
from hashlib import sha1
from ._normaliserABC import Normaliser
class ProbabilisticQuotientNormaliser(Normaliser):
def __init__(self, reference=None, referenceDescription=None):
self._normalisationcoefficients = None
self.reference = reference
self._data_hash = None
self._referenceDescription ... | true | true |
1c04a41c9477d31ee2887f43cd22008d1fabd053 | 1,101 | py | Python | apps/utils/email_send.py | luoyangC/luoyangc | a1e0d84e463d661fbd5e0333a4770d28048172ba | [
"MIT"
] | 1 | 2019-07-07T10:40:27.000Z | 2019-07-07T10:40:27.000Z | apps/utils/email_send.py | luoyangC/luoyangc_django | a1e0d84e463d661fbd5e0333a4770d28048172ba | [
"MIT"
] | null | null | null | apps/utils/email_send.py | luoyangC/luoyangc_django | a1e0d84e463d661fbd5e0333a4770d28048172ba | [
"MIT"
] | null | null | null | """
Created by Amor on 2018-09-23
发送邮件的脚本
"""
import random
from django.core.cache import cache
from django.core.mail import EmailMultiAlternatives
from luoyangc.settings import EMAIL_FROM
__author__ = '骆杨'
def send_email(email, send_type='register'):
code = make_random_code(email, send_type... | 30.583333 | 85 | 0.582198 | import random
from django.core.cache import cache
from django.core.mail import EmailMultiAlternatives
from luoyangc.settings import EMAIL_FROM
__author__ = '骆杨'
def send_email(email, send_type='register'):
code = make_random_code(email, send_type)
if send_type == 'register':
email_titl... | true | true |
1c04a473c4a3f29bf8c2545d6929ee99d2fab64b | 3,961 | py | Python | tests/test_database.py | aeldaly/plexcleaner | 853bb5b81325878071059b67a2cdad8d0b7311e5 | [
"Apache-2.0"
] | 8 | 2015-08-05T17:46:37.000Z | 2021-12-26T03:30:57.000Z | tests/test_database.py | aeldaly/plexcleaner | 853bb5b81325878071059b67a2cdad8d0b7311e5 | [
"Apache-2.0"
] | 2 | 2015-08-06T00:01:40.000Z | 2015-08-30T20:37:48.000Z | tests/test_database.py | aeldaly/plexcleaner | 853bb5b81325878071059b67a2cdad8d0b7311e5 | [
"Apache-2.0"
] | 1 | 2019-09-18T18:03:30.000Z | 2019-09-18T18:03:30.000Z | import unittest
from plexcleaner.exception import PlexCleanerException
from plexcleaner.database import Database
__author__ = 'Jean-Bernard Ratte - jean.bernard.ratte@unary.ca'
# flake8: noqa
class TestDatabase(unittest.TestCase):
def get_db(self):
db = Database(database_override=':memory:')
db._... | 44.011111 | 103 | 0.618531 | import unittest
from plexcleaner.exception import PlexCleanerException
from plexcleaner.database import Database
__author__ = 'Jean-Bernard Ratte - jean.bernard.ratte@unary.ca'
class TestDatabase(unittest.TestCase):
def get_db(self):
db = Database(database_override=':memory:')
db._cursor.execute(... | true | true |
1c04a4c69c50f9ce35fce8fd150d8ce42e91aded | 10,940 | py | Python | tests/test_visitors.py | xdslproject/devito | 44a3f00dc701924876ba23379291dddecd047ddc | [
"MIT"
] | null | null | null | tests/test_visitors.py | xdslproject/devito | 44a3f00dc701924876ba23379291dddecd047ddc | [
"MIT"
] | 2 | 2021-11-22T16:31:41.000Z | 2022-03-16T12:00:14.000Z | tests/test_visitors.py | xdslproject/devito | 44a3f00dc701924876ba23379291dddecd047ddc | [
"MIT"
] | null | null | null | import cgen as c
from sympy import Mod
import pytest
from devito import Grid, Eq, Function, TimeFunction, Operator, sin
from devito.ir.equations import DummyEq
from devito.ir.iet import (Block, Expression, Callable, FindNodes, FindSections,
FindSymbols, IsPerfectIteration, Transformer,
... | 29.018568 | 84 | 0.558592 | import cgen as c
from sympy import Mod
import pytest
from devito import Grid, Eq, Function, TimeFunction, Operator, sin
from devito.ir.equations import DummyEq
from devito.ir.iet import (Block, Expression, Callable, FindNodes, FindSections,
FindSymbols, IsPerfectIteration, Transformer,
... | true | true |
1c04a54e2621bb23300f8ef08bd083abf8d0fcbe | 1,068 | py | Python | convolution/triangle pulse.py | dong-zhan/calculus | f889e2ddcc78a175172094517512513f6550ab10 | [
"BSD-2-Clause"
] | null | null | null | convolution/triangle pulse.py | dong-zhan/calculus | f889e2ddcc78a175172094517512513f6550ab10 | [
"BSD-2-Clause"
] | null | null | null | convolution/triangle pulse.py | dong-zhan/calculus | f889e2ddcc78a175172094517512513f6550ab10 | [
"BSD-2-Clause"
] | null | null | null | def u(x):
if x<0 :
return 0
return 1
def pulse(x):
cnt = len(t)
y = np.zeros(cnt)
for i,v in np.ndenumerate(t):
if v < 0:
y[i] = 0
elif v > 2:
y[i] = 0
else:
y[i] = 2
return y
def negx(t):
cnt = len(t)
y = np.zeros(cnt)
for i,v in np.ndenumerate(t):
if v < 0:
y[i] = 0
elif v > 2:
... | 16.430769 | 86 | 0.544007 | def u(x):
if x<0 :
return 0
return 1
def pulse(x):
cnt = len(t)
y = np.zeros(cnt)
for i,v in np.ndenumerate(t):
if v < 0:
y[i] = 0
elif v > 2:
y[i] = 0
else:
y[i] = 2
return y
def negx(t):
cnt = len(t)
y = np.zeros(cnt)
for i,v in np.ndenumerate(t):
if v < 0:
y[i] = 0
elif v > 2:
... | true | true |
1c04a6235930fa3a5e56821db8ec853b986facc8 | 264 | py | Python | foxylib/tools/socialmedia/discord/discord_user.py | foxytrixy-com/foxylib | 94b8c5b9f8b12423393c68f7d9f910258840ed18 | [
"BSD-3-Clause"
] | null | null | null | foxylib/tools/socialmedia/discord/discord_user.py | foxytrixy-com/foxylib | 94b8c5b9f8b12423393c68f7d9f910258840ed18 | [
"BSD-3-Clause"
] | 3 | 2019-12-12T05:17:44.000Z | 2022-03-11T23:40:50.000Z | foxylib/tools/socialmedia/discord/discord_user.py | foxytrixy-com/foxylib | 94b8c5b9f8b12423393c68f7d9f910258840ed18 | [
"BSD-3-Clause"
] | 2 | 2019-10-16T17:39:34.000Z | 2020-02-10T06:32:08.000Z | class DiscordUser:
class Field:
ID = "id"
USERNAME = "username"
@classmethod
def user2id(cls, user):
return user.get(cls.Field.ID)
@classmethod
def user2username(cls, user):
return user.get(cls.Field.USERNAME)
| 20.307692 | 43 | 0.606061 | class DiscordUser:
class Field:
ID = "id"
USERNAME = "username"
@classmethod
def user2id(cls, user):
return user.get(cls.Field.ID)
@classmethod
def user2username(cls, user):
return user.get(cls.Field.USERNAME)
| true | true |
1c04a6c4df87bc1c3ab95a2f71342a44b4f2dd73 | 5,724 | py | Python | backUp/jd_disable.py | xizaha/qinglong | 9278b5d87c22867ac6bd88877b368170812d1480 | [
"MIT"
] | 16 | 2021-12-14T06:43:39.000Z | 2022-03-30T02:57:49.000Z | jd_disable.py | CoolCola/faker2 | be32a939367557fe6bf721af811204456f988237 | [
"MIT"
] | 2 | 2021-09-08T13:27:11.000Z | 2021-09-21T05:06:46.000Z | jd_disable.py | CoolCola/faker2 | be32a939367557fe6bf721af811204456f988237 | [
"MIT"
] | 7 | 2021-12-14T07:35:37.000Z | 2022-02-23T01:04:17.000Z | # -*- coding:utf-8 -*-
"""
cron: 20 10 */7 * *
new Env('禁用重复任务');
"""
import json
import logging
import os
import sys
import time
import traceback
import requests
logger = logging.getLogger(name=None) # 创建一个日志对象
logging.Formatter("%(message)s") # 日志内容格式化
logger.setLevel(logging.INFO) # 设置日志等级
logger.addHandler(lo... | 28.477612 | 136 | 0.587526 |
import json
import logging
import os
import sys
import time
import traceback
import requests
logger = logging.getLogger(name=None) logging.Formatter("%(message)s") logger.setLevel(logging.INFO) logger.addHandler(logging.StreamHandler())
ipport = os.getenv("IPPORT")
if not ipport:
logger.info(
"如果报错... | true | true |
1c04a740870d70ff6cbdfba3eb9b887b771438f6 | 6,176 | py | Python | cgi-bin/login.py | 5610110083/Safety-in-residential-project | 000a48f8c5e94f69497a40529f3540d6b1603ad1 | [
"Apache-2.0"
] | null | null | null | cgi-bin/login.py | 5610110083/Safety-in-residential-project | 000a48f8c5e94f69497a40529f3540d6b1603ad1 | [
"Apache-2.0"
] | null | null | null | cgi-bin/login.py | 5610110083/Safety-in-residential-project | 000a48f8c5e94f69497a40529f3540d6b1603ad1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-f
#Import modules for CGI handling
import cgi, cgitb
import Cookie, os, time
import requests
from datetime import datetime
from uuid import getnode as get_mac
import fcntl, socket, struct
# Instantiate a SimpleCookie object
cookie = Cookie.SimpleCookie()
cookie_string = o... | 35.291429 | 146 | 0.595045 | import cgi, cgitb
import Cookie, os, time
import requests
from datetime import datetime
from uuid import getnode as get_mac
import fcntl, socket, struct
cookie = Cookie.SimpleCookie()
cookie_string = os.environ.get('HTTP_COOKIE')
form = cgi.FieldStorage()
Username = form.getvalue('Username')
Password = form.getv... | false | true |
1c04a7b9e8b0c8c9727e706e0659c1211b9b6ad6 | 1,969 | py | Python | users.py | rbak1/grafanaclient | 736795c5e06cf443d71a87dab2002773a9ab69a2 | [
"MIT"
] | 1 | 2018-04-04T10:59:00.000Z | 2018-04-04T10:59:00.000Z | users.py | rbak/grafanaclient | 736795c5e06cf443d71a87dab2002773a9ab69a2 | [
"MIT"
] | null | null | null | users.py | rbak/grafanaclient | 736795c5e06cf443d71a87dab2002773a9ab69a2 | [
"MIT"
] | null | null | null | from twcmanage.lib.grafanaclient.utils import base
import userorgs
# Users generated by get do not include ids and cannot run the User methods.
class User(base.Resource):
def __repr__(self):
return '<User: %s>' % getattr(self, 'login', 'unknown-login')
def update(self, email=None, name=None, login=No... | 29.38806 | 76 | 0.555612 | from twcmanage.lib.grafanaclient.utils import base
import userorgs
class User(base.Resource):
def __repr__(self):
return '<User: %s>' % getattr(self, 'login', 'unknown-login')
def update(self, email=None, name=None, login=None):
return self.manager.update(email=email, name=name, login=login,
... | true | true |
1c04a80586cd934f57753d43d6c04b3b297b6e81 | 4,797 | py | Python | src/oci/core/models/network_security_group_vnic.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/core/models/network_security_group_vnic.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/core/models/network_security_group_vnic.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 31.352941 | 245 | 0.655827 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class NetworkSecurityGroupVnic(object):
def __init__(self, **kwargs):
self.swagger_types = {
'resource_id': 'st... | true | true |
1c04aa42d718407f00d3b4714930d8a480ac8a3a | 473 | py | Python | StatisticsCalc/mode.py | mjdroz/StatisticsCalculator | 6be77b650b16e1c3e8ed6160905d99e58449e9b4 | [
"MIT"
] | null | null | null | StatisticsCalc/mode.py | mjdroz/StatisticsCalculator | 6be77b650b16e1c3e8ed6160905d99e58449e9b4 | [
"MIT"
] | 18 | 2020-11-02T00:14:07.000Z | 2020-11-09T04:07:07.000Z | StatisticsCalc/mode.py | mjdroz/StatisticsCalculator | 6be77b650b16e1c3e8ed6160905d99e58449e9b4 | [
"MIT"
] | null | null | null | from collections import Counter
def mode (data):
try:
total_values = len(data)
count = Counter(data)
get_mode = dict(count)
mode = [a for a, v in get_mode.items() if v == max(list(count.values()))]
if len(mode) == total_values:
get_mode = "Mode was not found"
... | 24.894737 | 81 | 0.564482 | from collections import Counter
def mode (data):
try:
total_values = len(data)
count = Counter(data)
get_mode = dict(count)
mode = [a for a, v in get_mode.items() if v == max(list(count.values()))]
if len(mode) == total_values:
get_mode = "Mode was not found"
... | true | true |
1c04ab185dad572b1846a4a48e2de38f2405ceba | 23,319 | py | Python | src/a1_process_model.py | cpetrich/q-learning-car | 6c89c481e0d14fce7fa6bce7f59e3bded6048ca2 | [
"MIT"
] | 12 | 2018-06-24T01:44:51.000Z | 2022-01-18T04:28:36.000Z | src/a1_process_model.py | cpetrich/q-learning-car | 6c89c481e0d14fce7fa6bce7f59e3bded6048ca2 | [
"MIT"
] | null | null | null | src/a1_process_model.py | cpetrich/q-learning-car | 6c89c481e0d14fce7fa6bce7f59e3bded6048ca2 | [
"MIT"
] | 6 | 2018-12-24T03:32:32.000Z | 2021-11-20T09:46:44.000Z | import math as _math
import geometry as _g
import sys as _sys
if _sys.version_info.major != 2: reload = lambda x: 0
reload(_g)
# Author: Chris Petrich
# Date: 2016
# Apr 2018: modified for Python 3
class ModelState(object):
# This class is as fast for member access by name
# as tuples are for member acc... | 39.929795 | 152 | 0.655817 | import math as _math
import geometry as _g
import sys as _sys
if _sys.version_info.major != 2: reload = lambda x: 0
reload(_g)
class ModelState(object):
__slots__ = ('p_front_right',
'axis_dir',
'center_wheel_dir',
'distance_step',
... | true | true |
1c04abb98a307e2559d80b5ff111f7da6c9c36e4 | 3,853 | py | Python | python/http_client/v1/polyaxon_sdk/models/v1_project_version_kind.py | polyaxon/client | 1beaf78b0aa9fabc37b42a253d5e29c0623d8b16 | [
"Apache-2.0"
] | null | null | null | python/http_client/v1/polyaxon_sdk/models/v1_project_version_kind.py | polyaxon/client | 1beaf78b0aa9fabc37b42a253d5e29c0623d8b16 | [
"Apache-2.0"
] | null | null | null | python/http_client/v1/polyaxon_sdk/models/v1_project_version_kind.py | polyaxon/client | 1beaf78b0aa9fabc37b42a253d5e29c0623d8b16 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, 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 ... | 29.638462 | 77 | 0.608876 |
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re import six
from polyaxon_sdk.configuration import Configuration
class V1ProjectVersionKind(object):
COMPONENT = "component"
MODEL = "model"
ARTIFACT = "artifa... | true | true |
1c04ac0e9a78c0d51cb77c101ad2bd2d3ebe2791 | 282 | py | Python | account/urls.py | ardzix/pos_cooperative | 3d85884d50e501a50b6cd1c421d427a0b9373413 | [
"MIT"
] | 2 | 2018-04-29T19:59:04.000Z | 2020-01-29T10:32:28.000Z | account/urls.py | ardzix/instalment-app | 6a86d62497f51865a784d3e7e8e18175b8303480 | [
"MIT"
] | 1 | 2020-01-29T10:32:09.000Z | 2020-01-29T10:32:09.000Z | account/urls.py | ardzix/instalment-app | 6a86d62497f51865a784d3e7e8e18175b8303480 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from account.views import *
urlpatterns = [
url(r'^login/$', LoginView.as_view(), name='login'),
url(r'^logout/$', LogoutView.as_view(), name='logout'),
url(r'^change-password/$', ChangePasswordView.as_view(), name='change-password'),
] | 35.25 | 85 | 0.680851 | from django.conf.urls import url
from account.views import *
urlpatterns = [
url(r'^login/$', LoginView.as_view(), name='login'),
url(r'^logout/$', LogoutView.as_view(), name='logout'),
url(r'^change-password/$', ChangePasswordView.as_view(), name='change-password'),
] | true | true |
1c04ac5f9dd709720045041d840cf7a8f947e6d3 | 12,249 | py | Python | myven/lib/python3.8/site-packages/ansible/modules/cloud/amazon/aws_application_scaling_policy.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | myven/lib/python3.8/site-packages/ansible/modules/cloud/amazon/aws_application_scaling_policy.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | null | null | null | myven/lib/python3.8/site-packages/ansible/modules/cloud/amazon/aws_application_scaling_policy.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 41.522034 | 158 | 0.66536 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: aws_application_scaling_policy
short_description: Manage Ap... | true | true |
1c04ac81ff3e8cfbdb27c89a74232e293696adc3 | 2,323 | py | Python | mobile_friendly_repl_project.py | topherPedersen/Shareable-REPL-Embed-Template | 48e34a27acdcd8e994b57acb648d30802c1272de | [
"MIT"
] | null | null | null | mobile_friendly_repl_project.py | topherPedersen/Shareable-REPL-Embed-Template | 48e34a27acdcd8e994b57acb648d30802c1272de | [
"MIT"
] | null | null | null | mobile_friendly_repl_project.py | topherPedersen/Shareable-REPL-Embed-Template | 48e34a27acdcd8e994b57acb648d30802c1272de | [
"MIT"
] | null | null | null | import random
import time
length_of_pause = 2
##################################
print("")
print("Jerry Jonze Pro Football")
print("by Topher Pedersen")
print("")
time.sleep(length_of_pause)
##################################
print("You are Jerry Jonze, the")
time.sleep(length_of_pause)
print("billion... | 26.397727 | 66 | 0.626776 | import random
import time
length_of_pause = 2
print("")
print("Jerry Jonze Pro Football")
print("by Topher Pedersen")
print("")
time.sleep(length_of_pause)
print("You are Jerry Jonze, the")
time.sleep(length_of_pause)
print("billionaire oil tycoon")
time.sleep(length_of_pause)
print("and owner of the ... | true | true |
1c04ad74dbe119afb8f806df0214acc57df7e85e | 123 | py | Python | run.py | Reillym/stores-rest-api | eee11799c5d3c0bf0cbc29742a7cdd393ed96200 | [
"MIT"
] | 1 | 2020-08-09T20:09:23.000Z | 2020-08-09T20:09:23.000Z | run.py | Reillym/stores-rest-api | eee11799c5d3c0bf0cbc29742a7cdd393ed96200 | [
"MIT"
] | null | null | null | run.py | Reillym/stores-rest-api | eee11799c5d3c0bf0cbc29742a7cdd393ed96200 | [
"MIT"
] | null | null | null | from app import app
from db import db
db.init_app(app)
@app.before_first_request
def create_tables():
db.create_all() | 15.375 | 25 | 0.764228 | from app import app
from db import db
db.init_app(app)
@app.before_first_request
def create_tables():
db.create_all() | true | true |
1c04ade16133abdbd6d627f39cf053f30fe1350e | 3,761 | py | Python | pyqt-official/network/broadcastsender.py | a358003542/pyside2_examples | 5f337211e615a726541bf6766455d4f2c9d0f551 | [
"MIT"
] | 1 | 2020-02-11T08:22:28.000Z | 2020-02-11T08:22:28.000Z | pyqt-official/network/broadcastsender.py | a358003542/pyside2_examples | 5f337211e615a726541bf6766455d4f2c9d0f551 | [
"MIT"
] | null | null | null | pyqt-official/network/broadcastsender.py | a358003542/pyside2_examples | 5f337211e615a726541bf6766455d4f2c9d0f551 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... | 38.377551 | 91 | 0.693964 |
## modification, are permitted provided that the following conditions are
## met:
## * Redistributions of source code must retain the above copyright
## notice, this list of conditions and the following disclaimer.
## * Redistributions in binary form must reproduce the above copyright
## notice, this list... | true | true |
1c04aec14056da9b5342bc12297933e558ea12a8 | 5,600 | py | Python | Model/Classifier.py | CVPR2020/EnAET | f490777980d20c68ca63764b7fc25537d7e72660 | [
"MIT"
] | 3 | 2019-11-22T01:53:41.000Z | 2020-07-09T08:39:41.000Z | Model/Classifier.py | CVPR2020/EnAET | f490777980d20c68ca63764b7fc25537d7e72660 | [
"MIT"
] | 4 | 2021-03-19T08:30:03.000Z | 2022-01-13T01:51:10.000Z | Model/Classifier.py | CVPR2020/EnAET | f490777980d20c68ca63764b7fc25537d7e72660 | [
"MIT"
] | null | null | null | # /*******************************************************************************
# * Author : CVPR2020_EnAET
# *******************************************************************************/
import math
import torch.nn as nn
import numpy as np
from Model.Basic_Block import Flatten,BasicBlock,GlobalAveragePooling
fr... | 52.336449 | 103 | 0.605179 | import math
import torch.nn as nn
import numpy as np
from Model.Basic_Block import Flatten,BasicBlock,GlobalAveragePooling
from Model.Attention import Self_Attn
from Model.TEBlock import TEBlock1
class Classifier(nn.Module):
def __init__(self, _nChannels, _num_classes, _cls_type):
super(Classifier, self).__... | true | true |
1c04aed25a6a18baaff4f9a5d4d5479ac5d8e65b | 4,280 | py | Python | eva/models.py | aqutor/CE_Backend | 1265f7169aea0b6b8cff3fda742a8a5a295fe9ea | [
"MIT"
] | null | null | null | eva/models.py | aqutor/CE_Backend | 1265f7169aea0b6b8cff3fda742a8a5a295fe9ea | [
"MIT"
] | null | null | null | eva/models.py | aqutor/CE_Backend | 1265f7169aea0b6b8cff3fda742a8a5a295fe9ea | [
"MIT"
] | null | null | null | from django.db import models
from django.urls import reverse
from django.conf import settings
import datetime
import uuid
class Work(models.Model):
"""Model representing a book of Work"""
workName = models.CharField(max_length=30, null=False)
author = models.CharField(max_length=10, null=True)
pageNum... | 38.909091 | 99 | 0.63014 | from django.db import models
from django.urls import reverse
from django.conf import settings
import datetime
import uuid
class Work(models.Model):
workName = models.CharField(max_length=30, null=False)
author = models.CharField(max_length=10, null=True)
pageNum = models.IntegerField(null=False)
def ... | true | true |
1c04aef01a03962d013b28993f67149699d5385f | 5,295 | py | Python | test_string.py | eeweefr/Python | 41322b4288b5cb42514b65126b55c0a4e62ddeca | [
"MIT"
] | null | null | null | test_string.py | eeweefr/Python | 41322b4288b5cb42514b65126b55c0a4e62ddeca | [
"MIT"
] | null | null | null | test_string.py | eeweefr/Python | 41322b4288b5cb42514b65126b55c0a4e62ddeca | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*-coding:Utf-8 -*
#---------------------------------------------------------------------
mon_string = str() # On crée une liste vide
print("type: ")
print(type(mon_string))
#<class 'list'>
print(mon_string)
#---------------------------------------------------------------------
# lower :
aaa = ... | 26.083744 | 99 | 0.46289 |
mon_string = str() print("type: ")
print(type(mon_string))
print(mon_string)
aaa = "TEST POUR VOIR"
aaa = aaa.lower()
print( aaa )
print( type( aaa ) )
minuscules = "une chaine en minuscules"
print(minuscules.upper())
print(minuscules.capitalize())
espaces = " une chaine avec des espaces "
print(espac... | true | true |
1c04af3e58620c7f34f406ce0525f01dec02f967 | 234 | py | Python | vesamusictraining/user/views.py | vsiivola/vesamusictraining | eed77a9276fe0f32d38aefa449d361894712400e | [
"BSD-3-Clause"
] | 2 | 2016-01-08T02:59:20.000Z | 2016-10-24T17:37:08.000Z | vesamusictraining/user/views.py | vsiivola/vesamusictraining | eed77a9276fe0f32d38aefa449d361894712400e | [
"BSD-3-Clause"
] | null | null | null | vesamusictraining/user/views.py | vsiivola/vesamusictraining | eed77a9276fe0f32d38aefa449d361894712400e | [
"BSD-3-Clause"
] | null | null | null | """Nothing interesting here, redirect to main page."""
from django.http import HttpResponseRedirect
def home(request):
"""Redirect to main page"""
if request.user.is_authenticated():
return HttpResponseRedirect("/")
| 26 | 54 | 0.713675 | from django.http import HttpResponseRedirect
def home(request):
if request.user.is_authenticated():
return HttpResponseRedirect("/")
| true | true |
1c04af69e499225a5d1b20a759d15d4be49684d3 | 1,056 | py | Python | setup.py | eauel/genomic-synthetic-data-generation | 52d5654044e36c64825136057fc2309b37d1525d | [
"MIT"
] | null | null | null | setup.py | eauel/genomic-synthetic-data-generation | 52d5654044e36c64825136057fc2309b37d1525d | [
"MIT"
] | null | null | null | setup.py | eauel/genomic-synthetic-data-generation | 52d5654044e36c64825136057fc2309b37d1525d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from setuptools import setup, find_packages
VERSION = '0.1.0'
DESCRIPTION = 'Genotype synthetic data generator toolkit'
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Natural Language :: Eng... | 24 | 69 | 0.625947 |
from setuptools import setup, find_packages
VERSION = '0.1.0'
DESCRIPTION = 'Genotype synthetic data generator toolkit'
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating S... | true | true |
1c04af9f41a8004dff3afbaf9f8e618e1cbc79b6 | 5,859 | py | Python | docs/conf.py | jorgepiloto/ezaero | a7c1f31b191ea605e9a9802c645a0ffb0c98ce08 | [
"MIT"
] | 15 | 2019-05-16T08:48:37.000Z | 2022-03-01T20:28:00.000Z | docs/conf.py | jorgepiloto/ezaero | a7c1f31b191ea605e9a9802c645a0ffb0c98ce08 | [
"MIT"
] | 15 | 2019-05-11T17:19:35.000Z | 2020-11-03T10:03:46.000Z | docs/conf.py | jorgepiloto/ezaero | a7c1f31b191ea605e9a9802c645a0ffb0c98ce08 | [
"MIT"
] | 2 | 2019-05-16T07:43:24.000Z | 2020-10-22T08:30:48.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ezaero documentation build configuration file, created by
# sphinx-quickstart on Mon May 13 23:02:10 2019.
#
# 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
# aut... | 30.675393 | 86 | 0.68015 |
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx_gallery.gen_gallery']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
projec... | true | true |
1c04b0fd2aff1327f45bec9f6f7fd69a0face1ae | 16,287 | py | Python | luigi/contrib/sqla.py | srijan-deepsource/luigi | 55fcc8450a5641ab1019bca90335b86d2c0033a0 | [
"Apache-2.0"
] | null | null | null | luigi/contrib/sqla.py | srijan-deepsource/luigi | 55fcc8450a5641ab1019bca90335b86d2c0033a0 | [
"Apache-2.0"
] | null | null | null | luigi/contrib/sqla.py | srijan-deepsource/luigi | 55fcc8450a5641ab1019bca90335b86d2c0033a0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Gouthaman Balaraman
#
# 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 applic... | 39.245783 | 127 | 0.640142 |
import abc
import collections
import datetime
import itertools
import logging
import luigi
import os
import sqlalchemy
class SQLAlchemyTarget(luigi.Target):
marker_table = None
_engine_dict = {} Connection = collections.namedtuple("Connection", "engine pid")
def __init__(self, connection_string, t... | true | true |
1c04b12dc845cd973c551cd7a1fa4ee2734934cf | 622 | py | Python | panic/test/test_panic.py | sergirubio/panic | b7cfad21f62c42b342dc1969bf72394c3abddec0 | [
"CC-BY-3.0"
] | null | null | null | panic/test/test_panic.py | sergirubio/panic | b7cfad21f62c42b342dc1969bf72394c3abddec0 | [
"CC-BY-3.0"
] | 2 | 2016-09-22T13:13:50.000Z | 2016-09-23T07:32:38.000Z | panic/test/test_panic.py | sergirubio/panic | b7cfad21f62c42b342dc1969bf72394c3abddec0 | [
"CC-BY-3.0"
] | null | null | null |
import fandango as Fn
from fandango.log import InOutLogged
import fandango.tango as Ft
import panic
global api
api = None
@InOutLogged
def test_AlarmAPI():
global api
api = panic.api()
assert api
@InOutLogged
def test_AlarmDS(device=''):
if not device:
device = Fn.first((d for d,v in api.devices.items()... | 19.4375 | 86 | 0.717042 |
import fandango as Fn
from fandango.log import InOutLogged
import fandango.tango as Ft
import panic
global api
api = None
@InOutLogged
def test_AlarmAPI():
global api
api = panic.api()
assert api
@InOutLogged
def test_AlarmDS(device=''):
if not device:
device = Fn.first((d for d,v in api.devices.items()... | true | true |
1c04b1d1cf42ada9ef999aef82ee5bca97001cbc | 507 | py | Python | core/driver_handling.py | Dr3xler/CookieConsentChecker | 816cdfb9d9dc741c57dbcd5e9c9ef59837196631 | [
"MIT"
] | null | null | null | core/driver_handling.py | Dr3xler/CookieConsentChecker | 816cdfb9d9dc741c57dbcd5e9c9ef59837196631 | [
"MIT"
] | 3 | 2021-04-29T22:57:09.000Z | 2021-05-03T15:32:39.000Z | core/driver_handling.py | Dr3xler/CookieConsentChecker | 816cdfb9d9dc741c57dbcd5e9c9ef59837196631 | [
"MIT"
] | 1 | 2021-08-29T09:53:09.000Z | 2021-08-29T09:53:09.000Z | from selenium import webdriver
from sys import platform
from selenium.webdriver.firefox.webdriver import WebDriver
def webdriver_setup():
"""This method will load the firefox webdriver"""
# linux
# loading the webdriver for selenium
if platform == "linux":
driver = webdriver.Firefox(executabl... | 28.166667 | 80 | 0.715976 | from selenium import webdriver
from sys import platform
from selenium.webdriver.firefox.webdriver import WebDriver
def webdriver_setup():
if platform == "linux":
driver = webdriver.Firefox(executable_path=r"webdriver/geckodriver")
return driver
if platform == "win32":
driver =... | true | true |
1c04b2f2f5eb43a637f207d8a4c12f80f17b1095 | 2,516 | py | Python | loadingSourceFile.py | brzx/pydataloader | 005c347b8fd9aca0a35ecf8eccce0a35e7e6da52 | [
"BSD-2-Clause"
] | null | null | null | loadingSourceFile.py | brzx/pydataloader | 005c347b8fd9aca0a35ecf8eccce0a35e7e6da52 | [
"BSD-2-Clause"
] | null | null | null | loadingSourceFile.py | brzx/pydataloader | 005c347b8fd9aca0a35ecf8eccce0a35e7e6da52 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os, csv, sqlite3, pdb, codecs, sys
import iLoad
from utils import iLoadTools
#reload(sys)
#sys.setdefaultencoding("utf8")
class SourceFile:
def __init__(self, name, conn, log):
self.conn = conn
self.name = name
self.log = log
... | 35.43662 | 94 | 0.454293 |
import os, csv, sqlite3, pdb, codecs, sys
import iLoad
from utils import iLoadTools
class SourceFile:
def __init__(self, name, conn, log):
self.conn = conn
self.name = name
self.log = log
def loading(self):
dt = iLoadTools.DatabaseTool(self.conn)
csvfile... | true | true |
1c04b39915d7e14b0e3cfbb9cf741c2bb7ed50d7 | 985 | py | Python | migrations/versions/5930eec91aff_create_comment_model.py | 01king-ori/pitch-project | 197de50fe5e90c05cd229beec6d82f5cc3da62fc | [
"MIT"
] | null | null | null | migrations/versions/5930eec91aff_create_comment_model.py | 01king-ori/pitch-project | 197de50fe5e90c05cd229beec6d82f5cc3da62fc | [
"MIT"
] | null | null | null | migrations/versions/5930eec91aff_create_comment_model.py | 01king-ori/pitch-project | 197de50fe5e90c05cd229beec6d82f5cc3da62fc | [
"MIT"
] | null | null | null | """Create Comment model
Revision ID: 5930eec91aff
Revises: f6893ba0692f
Create Date: 2020-07-20 04:03:11.330694
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5930eec91aff'
down_revision = 'f6893ba0692f'
branch_labels = None
depends_on = None
def upgrade():... | 26.621622 | 65 | 0.675127 | from alembic import op
import sqlalchemy as sa
revision = '5930eec91aff'
down_revision = 'f6893ba0692f'
branch_labels = None
depends_on = None
def upgrade():
op.create_table('comments',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('pitch_comment', sa.String(), nullable=True),
sa.Colu... | true | true |
1c04b5b330e2e8341de31b8e75360ee3db0a45d0 | 11,324 | py | Python | tf_bind_transformer/training_utils.py | jeffhsu3/tf-bind-transformer | 18e95c51b654ea1876a303565532b20a0a386233 | [
"MIT"
] | 43 | 2021-12-08T02:20:58.000Z | 2022-03-29T18:18:10.000Z | tf_bind_transformer/training_utils.py | jeffhsu3/tf-bind-transformer | 18e95c51b654ea1876a303565532b20a0a386233 | [
"MIT"
] | null | null | null | tf_bind_transformer/training_utils.py | jeffhsu3/tf-bind-transformer | 18e95c51b654ea1876a303565532b20a0a386233 | [
"MIT"
] | 4 | 2021-12-24T02:10:00.000Z | 2022-01-11T19:49:10.000Z | import torch
from torch import nn
from tf_bind_transformer.optimizer import get_optimizer
from tf_bind_transformer.data import read_bed, collate_dl_outputs, get_dataloader, remap_df_add_experiment_target_cell
from tf_bind_transformer.data import RemapAllPeakDataset, NegativePeakDataset, ScopedNegativePeakDataset
def e... | 41.328467 | 148 | 0.651095 | import torch
from torch import nn
from tf_bind_transformer.optimizer import get_optimizer
from tf_bind_transformer.data import read_bed, collate_dl_outputs, get_dataloader, remap_df_add_experiment_target_cell
from tf_bind_transformer.data import RemapAllPeakDataset, NegativePeakDataset, ScopedNegativePeakDataset
def e... | true | true |
1c04b5ddf5d07743a4dbb29710da6d2387989719 | 12,628 | py | Python | run_predictions.py | Aaron506/caltech-ee148-spring2020-hw02 | aefe6755b9210f70f2983ec5c046f60ff12c5535 | [
"MIT"
] | null | null | null | run_predictions.py | Aaron506/caltech-ee148-spring2020-hw02 | aefe6755b9210f70f2983ec5c046f60ff12c5535 | [
"MIT"
] | null | null | null | run_predictions.py | Aaron506/caltech-ee148-spring2020-hw02 | aefe6755b9210f70f2983ec5c046f60ff12c5535 | [
"MIT"
] | null | null | null | import os
import numpy as np
import json
from PIL import Image, ImageDraw, ImageFont
# Aaron added
import matplotlib.pyplot as plt
import pdb
from numba import jit
# Only used to provide a standard data structure to speed up clustering
from unionfind import unionfind
if __name__ == '__main__':
plt.close('all')
... | 34.883978 | 150 | 0.60643 | import os
import numpy as np
import json
from PIL import Image, ImageDraw, ImageFont
import matplotlib.pyplot as plt
import pdb
from numba import jit
from unionfind import unionfind
if __name__ == '__main__':
plt.close('all')
ACCEPT = 0.5
def visualize(I, output, disp=False):
im = Image.fromarra... | true | true |
1c04b789cfff4929194b815330a92bb03ee32366 | 26,394 | py | Python | examples/functions/python3/mmlogic-simple/api/protobuf_spec/messages_pb2.py | rmb938/open-match | 6dd23ff6ada9bb7ac23a248c22fa81b2982d8f2d | [
"Apache-2.0"
] | null | null | null | examples/functions/python3/mmlogic-simple/api/protobuf_spec/messages_pb2.py | rmb938/open-match | 6dd23ff6ada9bb7ac23a248c22fa81b2982d8f2d | [
"Apache-2.0"
] | null | null | null | examples/functions/python3/mmlogic-simple/api/protobuf_spec/messages_pb2.py | rmb938/open-match | 6dd23ff6ada9bb7ac23a248c22fa81b2982d8f2d | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: api/protobuf-spec/messages.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import r... | 37.705714 | 2,067 | 0.731265 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _s... | true | true |
1c04b8775450fea39c402cbd4755ec39c6a7de10 | 4,935 | py | Python | main_file.py | aliayub7/CBCL | 23b92dc4323ccc97984905e616fc26a33e387e52 | [
"MIT"
] | 6 | 2020-07-30T12:14:58.000Z | 2022-03-27T19:35:54.000Z | main_file.py | aliayub7/FSIL | 23b92dc4323ccc97984905e616fc26a33e387e52 | [
"MIT"
] | 3 | 2021-07-01T08:30:36.000Z | 2021-11-25T04:33:52.000Z | main_file.py | aliayub7/FSIL | 23b92dc4323ccc97984905e616fc26a33e387e52 | [
"MIT"
] | 2 | 2021-02-09T04:19:44.000Z | 2022-03-21T12:42:51.000Z | """
Complete CBCL code
"""
import numpy as np
from copy import deepcopy
import pickle
from multiprocessing import Pool
from sklearn.model_selection import train_test_split
from Functions import get_centroids
from Functions import check_reduce_centroids
from Functions import get_test_accuracy
from get_incremental_data ... | 42.179487 | 155 | 0.728267 |
import numpy as np
from copy import deepcopy
import pickle
from multiprocessing import Pool
from sklearn.model_selection import train_test_split
from Functions import get_centroids
from Functions import check_reduce_centroids
from Functions import get_test_accuracy
from get_incremental_data import getIncrementalData
i... | true | true |
1c04b91d3a454b620aa202351782e9ef93237812 | 1,209 | py | Python | code/python/echomesh/element/Pattern.py | silky/echomesh | 2fe5a00a79c215b4aca4083e5252fcdcbd0507aa | [
"MIT"
] | 1 | 2019-06-27T11:34:13.000Z | 2019-06-27T11:34:13.000Z | code/python/echomesh/element/Pattern.py | silky/echomesh | 2fe5a00a79c215b4aca4083e5252fcdcbd0507aa | [
"MIT"
] | null | null | null | code/python/echomesh/element/Pattern.py | silky/echomesh | 2fe5a00a79c215b4aca4083e5252fcdcbd0507aa | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
from echomesh.element import Element
from echomesh.light import LightSingleton
from echomesh.util import Log
LOGGER = Log.logger(__name__)
class Pattern(Element.Element):
def __init__(self, parent, description):
super(Pattern, s... | 30.225 | 82 | 0.719603 | from __future__ import absolute_import, division, print_function, unicode_literals
from echomesh.element import Element
from echomesh.light import LightSingleton
from echomesh.util import Log
LOGGER = Log.logger(__name__)
class Pattern(Element.Element):
def __init__(self, parent, description):
super(Pattern, s... | true | true |
1c04ba18ded185f1e85b27e67f9c49df367b83d6 | 685 | py | Python | skyfield/tests/test_magnitudes.py | skyfielders/python-skyfield | b438e9fb8e1cbc6ea5b224d06f9a7dba6f0fff53 | [
"MIT"
] | 765 | 2015-04-15T22:54:43.000Z | 2022-03-31T10:02:16.000Z | skyfield/tests/test_magnitudes.py | skyfielders/python-skyfield | b438e9fb8e1cbc6ea5b224d06f9a7dba6f0fff53 | [
"MIT"
] | 589 | 2015-04-18T16:32:35.000Z | 2022-03-31T09:35:33.000Z | skyfield/tests/test_magnitudes.py | skyfielders/python-skyfield | b438e9fb8e1cbc6ea5b224d06f9a7dba6f0fff53 | [
"MIT"
] | 169 | 2015-04-15T19:47:38.000Z | 2022-03-11T13:15:44.000Z | from skyfield.api import load
from skyfield.magnitudelib import planetary_magnitude
def test_magnitudes():
ts = load.timescale()
#t = ts.utc(1995, 5, 22) # Rings edge-on from Earth.
t = ts.utc(2021, 10, 4)
eph = load('de421.bsp')
names = [
'mercury', 'venus', 'mars', 'jupiter barycenter',
... | 36.052632 | 74 | 0.610219 | from skyfield.api import load
from skyfield.magnitudelib import planetary_magnitude
def test_magnitudes():
ts = load.timescale()
t = ts.utc(2021, 10, 4)
eph = load('de421.bsp')
names = [
'mercury', 'venus', 'mars', 'jupiter barycenter',
'saturn barycenter', 'uranus barycenter', 'nep... | true | true |
1c04bb05d50c8ef06fcd38c29a2a593fbe54e019 | 6,682 | py | Python | bootcamp/users/views.py | elbakouchi/bootcamp | 2c7a0cd2ddb7632acb3009f94d728792ddf9644f | [
"MIT"
] | null | null | null | bootcamp/users/views.py | elbakouchi/bootcamp | 2c7a0cd2ddb7632acb3009f94d728792ddf9644f | [
"MIT"
] | null | null | null | bootcamp/users/views.py | elbakouchi/bootcamp | 2c7a0cd2ddb7632acb3009f94d728792ddf9644f | [
"MIT"
] | null | null | null | import os
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import render, redirect
from django.conf import settings as django_settings
from django.urls import reverse
from django.views.generic import DetailView, ListView, RedirectV... | 31.819048 | 87 | 0.636785 | import os
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import render, redirect
from django.conf import settings as django_settings
from django.urls import reverse
from django.views.generic import DetailView, ListView, RedirectV... | true | true |
1c04bb2198be6dbf718d3a67c4d77b4a5b699f34 | 46,866 | py | Python | lib/inputstreamhelper/__init__.py | frodo19/script.module.inputstreamhelper | 123e3f4050a888adb864d5e46ca7bdaa63da1a5f | [
"MIT"
] | null | null | null | lib/inputstreamhelper/__init__.py | frodo19/script.module.inputstreamhelper | 123e3f4050a888adb864d5e46ca7bdaa63da1a5f | [
"MIT"
] | null | null | null | lib/inputstreamhelper/__init__.py | frodo19/script.module.inputstreamhelper | 123e3f4050a888adb864d5e46ca7bdaa63da1a5f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
''' Implements the main InputStream Helper class '''
from __future__ import absolute_import, division, unicode_literals
import os
from inputstreamhelper import config
from .kodiutils import (addon_profile, browsesingle, get_addon_info, get_proxies, get_setting, jsonrpc, kodi_to_ascii, localize,
... | 42.183618 | 152 | 0.601523 | from __future__ import absolute_import, division, unicode_literals
import os
from inputstreamhelper import config
from .kodiutils import (addon_profile, browsesingle, get_addon_info, get_proxies, get_setting, jsonrpc, kodi_to_ascii, localize,
log, notification, ok_dialog, progress_dialog, select... | true | true |
1c04bbf01c459890b136a85f02fecf87b5220fd7 | 601 | py | Python | sb_backend/cli/cli.py | DmitriyGrigoriev/sb-fastapi | 1aef3db6ce26ea054e048e5927552d48c2eccbfb | [
"MIT"
] | null | null | null | sb_backend/cli/cli.py | DmitriyGrigoriev/sb-fastapi | 1aef3db6ce26ea054e048e5927552d48c2eccbfb | [
"MIT"
] | null | null | null | sb_backend/cli/cli.py | DmitriyGrigoriev/sb-fastapi | 1aef3db6ce26ea054e048e5927552d48c2eccbfb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""sb-fastapi CLI root."""
import logging
import click
from sb_backend.cli.commands.serve import serve
@click.group()
@click.option(
"-v",
"--verbose",
help="Enable verbose logging.",
is_flag=True,
default=False,
)
def cli(**options):
"""sb-fastapi CLI root."""
if ... | 18.78125 | 73 | 0.582363 | import logging
import click
from sb_backend.cli.commands.serve import serve
@click.group()
@click.option(
"-v",
"--verbose",
help="Enable verbose logging.",
is_flag=True,
default=False,
)
def cli(**options):
if options["verbose"]:
level = logging.DEBUG
else:
level = loggin... | true | true |
1c04be0055d91d6336afb066cf642e0d0011ab96 | 2,998 | py | Python | lbry/wallet/bcd_data_stream.py | nishp77/lbry-sdk | 7531401623a393a1491e3b65de0e2a65f8e45020 | [
"MIT"
] | 4,996 | 2019-06-21T04:44:34.000Z | 2022-03-31T14:24:52.000Z | lbry/wallet/bcd_data_stream.py | nishp77/lbry-sdk | 7531401623a393a1491e3b65de0e2a65f8e45020 | [
"MIT"
] | 1,934 | 2015-11-25T20:40:45.000Z | 2019-06-21T00:50:03.000Z | lbry/wallet/bcd_data_stream.py | nishp77/lbry-sdk | 7531401623a393a1491e3b65de0e2a65f8e45020 | [
"MIT"
] | 369 | 2015-12-05T21:18:07.000Z | 2019-06-10T12:40:50.000Z | import struct
from io import BytesIO
class BCDataStream:
def __init__(self, data=None):
self.data = BytesIO(data)
def reset(self):
self.data.seek(0)
def get_bytes(self):
return self.data.getvalue()
def read(self, size):
return self.data.read(size)
def write(sel... | 24.373984 | 50 | 0.601734 | import struct
from io import BytesIO
class BCDataStream:
def __init__(self, data=None):
self.data = BytesIO(data)
def reset(self):
self.data.seek(0)
def get_bytes(self):
return self.data.getvalue()
def read(self, size):
return self.data.read(size)
def write(sel... | true | true |
1c04c02e833766b70f5aae7daf66252749319947 | 109,837 | py | Python | tests/pipeline/test_quarters_estimates.py | dreamtimedapp/catalyst | eecd6ee6558950eb3ab00591a31f7ed6bf2f432e | [
"Apache-2.0"
] | 6 | 2019-05-23T17:52:22.000Z | 2022-01-30T08:13:19.000Z | tests/pipeline/test_quarters_estimates.py | Donstesh/catalyst | 83e2e2b23c0266bde1c11e68a6acde7460c6eadf | [
"Apache-2.0"
] | null | null | null | tests/pipeline/test_quarters_estimates.py | Donstesh/catalyst | 83e2e2b23c0266bde1c11e68a6acde7460c6eadf | [
"Apache-2.0"
] | 1 | 2020-10-29T16:14:10.000Z | 2020-10-29T16:14:10.000Z | from __future__ import division
from datetime import timedelta
from functools import partial
import blaze as bz
import itertools
from nose.tools import assert_true
from nose_parameterized import parameterized
import numpy as np
from numpy.testing import assert_array_equal, assert_almost_equal
import pandas as pd
from... | 40.115778 | 79 | 0.548203 | from __future__ import division
from datetime import timedelta
from functools import partial
import blaze as bz
import itertools
from nose.tools import assert_true
from nose_parameterized import parameterized
import numpy as np
from numpy.testing import assert_array_equal, assert_almost_equal
import pandas as pd
from... | true | true |
1c04c1a9f2b4c27f2e2d89d26a85a022c88b3c9f | 35 | py | Python | braindecode/samplers/__init__.py | ErikBjare/braindecode | d77788d4813d353b65f0bfc61c6129015b0390b4 | [
"BSD-3-Clause"
] | null | null | null | braindecode/samplers/__init__.py | ErikBjare/braindecode | d77788d4813d353b65f0bfc61c6129015b0390b4 | [
"BSD-3-Clause"
] | null | null | null | braindecode/samplers/__init__.py | ErikBjare/braindecode | d77788d4813d353b65f0bfc61c6129015b0390b4 | [
"BSD-3-Clause"
] | 1 | 2020-12-20T17:24:43.000Z | 2020-12-20T17:24:43.000Z | from .base import RecordingSampler
| 17.5 | 34 | 0.857143 | from .base import RecordingSampler
| true | true |
1c04c269882adc9c2f32457da0db9045f00d2312 | 20,416 | py | Python | dbops_venv/lib/python3.5/site-packages/mako/parsetree.py | fractal520/dbops | 20c6b6b5669e09b43cd19e6f3fa0448bc7d5eaac | [
"MIT"
] | 15 | 2016-02-24T06:32:57.000Z | 2020-06-17T05:06:36.000Z | dbops_venv/lib/python3.5/site-packages/mako/parsetree.py | fractal520/dbops | 20c6b6b5669e09b43cd19e6f3fa0448bc7d5eaac | [
"MIT"
] | null | null | null | dbops_venv/lib/python3.5/site-packages/mako/parsetree.py | fractal520/dbops | 20c6b6b5669e09b43cd19e6f3fa0448bc7d5eaac | [
"MIT"
] | 4 | 2017-02-04T13:45:31.000Z | 2018-07-05T11:57:24.000Z | # mako/parsetree.py
# Copyright (C) 2006-2013 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""defines the parse tree components for Mako templates."""
from mako import exceptions, ast, u... | 34.312605 | 82 | 0.527625 |
from mako import exceptions, ast, util, filters, compat
import re
class Node(object):
def __init__(self, source, lineno, pos, filename):
self.source = source
self.lineno = lineno
self.pos = pos
self.filename = filename
@property
def exception_kwargs(self):
return... | true | true |
1c04c29cd327ce7284b6ddbe25a091d46c4bb997 | 355 | py | Python | experiments/heat-3d/tmp_files/3517.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/heat-3d/tmp_files/3517.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/heat-3d/tmp_files/3517.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/heat-3d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/heat-3d/tmp_files/3517.c')
procedure('kernel_heat_3d')
loop(0)
known('n>3')
tile(0,2,8,2)
tile(0,4,16... | 25.357143 | 116 | 0.752113 | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/heat-3d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/heat-3d/tmp_files/3517.c')
procedure('kernel_heat_3d')
loop(0)
known('n>3')
tile(0,2,8,2)
tile(0,4,16... | true | true |
1c04c2a23499c92a9f80d95390ecec3444f0be47 | 1,007 | py | Python | drivers/motor/motor.py | StMaHa/micropython-examples | 9fc6353f343c8f077af19618786d17f932645116 | [
"Unlicense"
] | null | null | null | drivers/motor/motor.py | StMaHa/micropython-examples | 9fc6353f343c8f077af19618786d17f932645116 | [
"Unlicense"
] | null | null | null | drivers/motor/motor.py | StMaHa/micropython-examples | 9fc6353f343c8f077af19618786d17f932645116 | [
"Unlicense"
] | null | null | null | from machine import Pin, PWM
class Motor:
def __init__(self, pin1, pin2, pwm=False):
self.max_duty_cycle = 1023
self.pwm = pwm
if self.pwm:
self.pin1 = PWM(Pin(pin1), freq=500, duty=0)
self.pin2 = PWM(Pin(pin2), freq=500, duty=0)
else:
self... | 26.5 | 60 | 0.490566 | from machine import Pin, PWM
class Motor:
def __init__(self, pin1, pin2, pwm=False):
self.max_duty_cycle = 1023
self.pwm = pwm
if self.pwm:
self.pin1 = PWM(Pin(pin1), freq=500, duty=0)
self.pin2 = PWM(Pin(pin2), freq=500, duty=0)
else:
self... | true | true |
1c04c347dd680e10dc44ab3962a8fd3cfa3d61cd | 1,596 | py | Python | azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_server.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_server.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/network/v2016_09_01/models/application_gateway_backend_health_server.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# C... | 40.923077 | 88 | 0.620927 |
from msrest.serialization import Model
class ApplicationGatewayBackendHealthServer(Model):
_attribute_map = {
'address': {'key': 'address', 'type': 'str'},
'ip_configuration': {'key': 'ipConfiguration', 'type': 'SubResource'},
'health': {'key': 'health', 'type': 'str'},
}
... | true | true |
1c04c378c1620c3980c85a279b4f52386a740674 | 616 | py | Python | build/rosserial/rosserial_arduino/cmake/rosserial_arduino-genmsg-context.py | ankit131199/Rebellious-Cowards | 56ec395147f2fc59a26669a74a04fe02227bc7b7 | [
"BSD-2-Clause"
] | null | null | null | build/rosserial/rosserial_arduino/cmake/rosserial_arduino-genmsg-context.py | ankit131199/Rebellious-Cowards | 56ec395147f2fc59a26669a74a04fe02227bc7b7 | [
"BSD-2-Clause"
] | null | null | null | build/rosserial/rosserial_arduino/cmake/rosserial_arduino-genmsg-context.py | ankit131199/Rebellious-Cowards | 56ec395147f2fc59a26669a74a04fe02227bc7b7 | [
"BSD-2-Clause"
] | 3 | 2020-10-01T15:22:00.000Z | 2020-10-01T17:06:55.000Z | # generated from genmsg/cmake/pkg-genmsg.context.in
messages_str = "/home/sasuke/catkin_ws/src/rosserial/rosserial_arduino/msg/Adc.msg"
services_str = "/home/sasuke/catkin_ws/src/rosserial/rosserial_arduino/srv/Test.srv"
pkg_name = "rosserial_arduino"
dependencies_str = ""
langs = "gencpp;geneus;genlisp;gennodejs;genp... | 51.333333 | 105 | 0.800325 |
messages_str = "/home/sasuke/catkin_ws/src/rosserial/rosserial_arduino/msg/Adc.msg"
services_str = "/home/sasuke/catkin_ws/src/rosserial/rosserial_arduino/srv/Test.srv"
pkg_name = "rosserial_arduino"
dependencies_str = ""
langs = "gencpp;geneus;genlisp;gennodejs;genpy"
dep_include_paths_str = "rosserial_arduino;/home/... | true | true |
1c04c3d0e6bfb66a587687e2e6a0edadae352d71 | 3,131 | py | Python | deploy/determined_deploy/aws/deployment_types/secure.py | sean-adler/determined | 5bdc0e33ef245b1168aa3835c3867b8f6532f2ae | [
"Apache-2.0"
] | null | null | null | deploy/determined_deploy/aws/deployment_types/secure.py | sean-adler/determined | 5bdc0e33ef245b1168aa3835c3867b8f6532f2ae | [
"Apache-2.0"
] | null | null | null | deploy/determined_deploy/aws/deployment_types/secure.py | sean-adler/determined | 5bdc0e33ef245b1168aa3835c3867b8f6532f2ae | [
"Apache-2.0"
] | null | null | null | import boto3
from determined_deploy.aws import aws, constants
from determined_deploy.aws.deployment_types import base
class Secure(base.DeterminedDeployment):
ssh_command = (
"SSH to Determined Master: ssh -i <keypair> ubuntu@{master_ip} -o "
'"proxycommand ssh -W %h:%p -i <keypair> ubuntu@{bast... | 39.1375 | 97 | 0.678058 | import boto3
from determined_deploy.aws import aws, constants
from determined_deploy.aws.deployment_types import base
class Secure(base.DeterminedDeployment):
ssh_command = (
"SSH to Determined Master: ssh -i <keypair> ubuntu@{master_ip} -o "
'"proxycommand ssh -W %h:%p -i <keypair> ubuntu@{bast... | true | true |
1c04c428dab7f1dd9fd7c2080390490775c7f440 | 9,322 | py | Python | blender/arm/lib/make_datas.py | astronalta/armory-3d | 15fa9fe50587e9e054cc5176f9a7de334cce5113 | [
"Zlib"
] | null | null | null | blender/arm/lib/make_datas.py | astronalta/armory-3d | 15fa9fe50587e9e054cc5176f9a7de334cce5113 | [
"Zlib"
] | null | null | null | blender/arm/lib/make_datas.py | astronalta/armory-3d | 15fa9fe50587e9e054cc5176f9a7de334cce5113 | [
"Zlib"
] | null | null | null | import os
import arm.utils
import arm.assets as assets
def write_data(res, defs, json_data, base_name):
# Define
sres = {}
res['shader_datas'].append(sres)
shader_id = base_name
sres['name'] = shader_id
sres['contexts'] = []
asset = assets.shader_passes_assets[base_name]
# Parse
... | 38.841667 | 221 | 0.425552 | import os
import arm.utils
import arm.assets as assets
def write_data(res, defs, json_data, base_name):
sres = {}
res['shader_datas'].append(sres)
shader_id = base_name
sres['name'] = shader_id
sres['contexts'] = []
asset = assets.shader_passes_assets[base_name]
for c in json_da... | true | true |
1c04c594874eeddf15501c5977c589c8e34678fb | 741 | py | Python | __init__.py | IloveKanade/k3cat | 1ebe8ae95692e857d0b534eae73c91099d27e764 | [
"MIT"
] | null | null | null | __init__.py | IloveKanade/k3cat | 1ebe8ae95692e857d0b534eae73c91099d27e764 | [
"MIT"
] | 1 | 2022-03-23T06:50:02.000Z | 2022-03-23T06:50:02.000Z | __init__.py | IloveKanade/k3cat | 1ebe8ae95692e857d0b534eae73c91099d27e764 | [
"MIT"
] | 1 | 2021-08-18T02:57:01.000Z | 2021-08-18T02:57:01.000Z | """
Just like nix command cat or tail, it continuously scan a file line by line.
It provides with two way for user to handle lines: as a generator or specifying
a handler function.
It also remembers the offset of the last scanning in a file in `/tmp/`.
If a file does not change(inode number does not change), it scans... | 18.073171 | 79 | 0.673414 |
__version__ = "0.1.0"
__name__ = "k3cat"
from .cat import (
SEEK_END,
SEEK_START,
CatError,
LockTimeout,
NoData,
NoSuchFile,
Cat
)
__all__ = [
"SEEK_END",
"SEEK_START",
"CatError",
"LockTimeout",
"NoData",
"NoSuchFile",
"Cat",
]
| true | true |
1c04c59786c43aa33b2e05c2b946c3292eae1596 | 3,147 | py | Python | dopedcat/dope.py | hieuadoan/DopedCat | a28692872c2e79935dbae45ef51f90dc58f7b624 | [
"MIT"
] | null | null | null | dopedcat/dope.py | hieuadoan/DopedCat | a28692872c2e79935dbae45ef51f90dc58f7b624 | [
"MIT"
] | null | null | null | dopedcat/dope.py | hieuadoan/DopedCat | a28692872c2e79935dbae45ef51f90dc58f7b624 | [
"MIT"
] | null | null | null | import sys
from catkit import Gratoms
from catkit.build import molecule
from catkit.gen.adsorption import Builder
from copy import copy, deepcopy
from ase.utils import natural_cutoffs
from ase.neighborlist import NeighborList
def offsetAdatoms(atoms,tol=1.):
""" Check for off surface adatoms"""
z_sum = 0
o... | 36.172414 | 94 | 0.641246 | import sys
from catkit import Gratoms
from catkit.build import molecule
from catkit.gen.adsorption import Builder
from copy import copy, deepcopy
from ase.utils import natural_cutoffs
from ase.neighborlist import NeighborList
def offsetAdatoms(atoms,tol=1.):
z_sum = 0
offsetIdList = []
tagList = atoms.get_... | true | true |
1c04c6e46caaec6c788cc8f29b92229ae84dfc83 | 6,137 | py | Python | userbot/prettyjson.py | NoCrypt/Userbit | 4cc50b7e2d531b80746b595b6bfa54d25f25b360 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2019-08-12T11:59:48.000Z | 2019-08-12T11:59:48.000Z | userbot/prettyjson.py | NoCrypt/Userbit | 4cc50b7e2d531b80746b595b6bfa54d25f25b360 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/prettyjson.py | NoCrypt/Userbit | 4cc50b7e2d531b80746b595b6bfa54d25f25b360 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2020-04-10T20:54:18.000Z | 2020-04-11T13:35:04.000Z | # https://github.com/andy-gh/prettyjson/blob/master/prettyjson.py
def prettyjson(obj, indent=2, maxlinelength=80):
"""Renders JSON content with indentation and line splits/concatenations to fit maxlinelength.
Only dicts, lists and basic types are supported"""
items, _ = getsubitems(obj, itemkey="", islas... | 41.466216 | 130 | 0.568193 |
def prettyjson(obj, indent=2, maxlinelength=80):
items, _ = getsubitems(obj, itemkey="", islast=True, maxlinelength=maxlinelength - indent, indent=indent)
return indentitems(items, indent, level=0)
def getsubitems(obj, itemkey, islast, maxlinelength, indent):
items = []
is_inline = True
i... | true | true |
1c04c703267703c3effcfd6ccc802185c6481d8f | 1,260 | py | Python | utils/viz_pointcloud.py | Dung-Han-Lee/Pointcloud-based-Row-Detection-using-ShellNet-and-PyTorch | 9b57969cf05818839a7ecce37163752e3fddec5e | [
"MIT"
] | 8 | 2020-08-07T20:15:31.000Z | 2021-11-16T02:23:37.000Z | utils/viz_pointcloud.py | Dung-Han-Lee/Pointcloud-based-Row-Detection-using-ShellNet-and-PyTorch | 9b57969cf05818839a7ecce37163752e3fddec5e | [
"MIT"
] | null | null | null | utils/viz_pointcloud.py | Dung-Han-Lee/Pointcloud-based-Row-Detection-using-ShellNet-and-PyTorch | 9b57969cf05818839a7ecce37163752e3fddec5e | [
"MIT"
] | 4 | 2020-08-21T06:17:01.000Z | 2021-11-24T07:45:20.000Z | from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
from math import pi, radians, degrees, cos, sin
import sys
import cv2
import os
def show_semantic(label, pointcloud, ground_truth=0, view='front', color='r'):
"""
Args:
label : (N, ) numpy semantic annotati... | 28 | 84 | 0.576984 | from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
from math import pi, radians, degrees, cos, sin
import sys
import cv2
import os
def show_semantic(label, pointcloud, ground_truth=0, view='front', color='r'):
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d'... | true | true |
1c04c7c9c685ae0ac33f8b786a052ea20ed4ce44 | 12,386 | py | Python | mak/build_framework/configure/compiler/suncc.py | bugengine/BugEngine | 1b3831d494ee06b0bd74a8227c939dd774b91226 | [
"BSD-3-Clause"
] | 4 | 2015-05-13T16:28:36.000Z | 2017-05-24T15:34:14.000Z | mak/build_framework/configure/compiler/suncc.py | bugengine/BugEngine | 1b3831d494ee06b0bd74a8227c939dd774b91226 | [
"BSD-3-Clause"
] | null | null | null | mak/build_framework/configure/compiler/suncc.py | bugengine/BugEngine | 1b3831d494ee06b0bd74a8227c939dd774b91226 | [
"BSD-3-Clause"
] | 1 | 2017-03-21T08:28:07.000Z | 2017-03-21T08:28:07.000Z | from waflib import Utils, Logs, Configure
import os
import sys
class SunCC(Configure.ConfigurationContext.GnuCompiler):
DEFINES = ['__SUNPRO_CC']
NAMES = ('SunCC', )
SUNCC_PLATFORMS = {
'__gnu_linux__': 'linux-gnu',
'__gnu__linux__': 'linux-gnu',
'__sun': 'sunos',
}
SUNCC_A... | 43.156794 | 119 | 0.468836 | from waflib import Utils, Logs, Configure
import os
import sys
class SunCC(Configure.ConfigurationContext.GnuCompiler):
DEFINES = ['__SUNPRO_CC']
NAMES = ('SunCC', )
SUNCC_PLATFORMS = {
'__gnu_linux__': 'linux-gnu',
'__gnu__linux__': 'linux-gnu',
'__sun': 'sunos',
}
SUNCC_A... | true | true |
1c04c7ec0bdf99e8f790f6f22c51a54969c1da70 | 751 | py | Python | Python/Code/Python3-Base/09_Functional/Closure.py | hiloWang/notes | 64a637a86f734e4e80975f4aa93ab47e8d7e8b64 | [
"Apache-2.0"
] | 2 | 2020-10-08T13:22:08.000Z | 2021-07-28T14:45:41.000Z | Python/Python3-Base/09_Functional/Closure.py | flyfire/Programming-Notes-Code | 4b1bdd74c1ba0c007c504834e4508ec39f01cd94 | [
"Apache-2.0"
] | null | null | null | Python/Python3-Base/09_Functional/Closure.py | flyfire/Programming-Notes-Code | 4b1bdd74c1ba0c007c504834e4508ec39f01cd94 | [
"Apache-2.0"
] | 6 | 2020-08-20T07:19:17.000Z | 2022-03-02T08:16:21.000Z | #########################
# 函数式编程:闭包
#########################
from pkg.Tools import print_divider
# 1 认识闭包
print_divider("闭包")
def curve_pre():
a = 10
def curve(x):
return a * x * x
return curve
curve = curve_pre()
print(curve(10))
print(curve) # <function curve_pre.<locals>.curve at 0x000... | 17.880952 | 93 | 0.631158 | from pkg.Tools import print_divider
print_divider("闭包")
def curve_pre():
a = 10
def curve(x):
return a * x * x
return curve
curve = curve_pre()
print(curve(10))
print(curve) print(curve.__closure__)
print_divider("闭包应用")
def traveller(paces):
def go(pace):
nonlocal paces
... | true | true |
1c04c83e7a81c6f29a9ed9f267d77551b78128e2 | 9,616 | py | Python | arkane/statmechTest.py | tza0035/RMG-Py | 38c49f7107d1b19e4a534408a1040ddd313b8596 | [
"MIT"
] | 250 | 2015-06-06T23:32:00.000Z | 2022-03-22T16:45:16.000Z | arkane/statmechTest.py | tza0035/RMG-Py | 38c49f7107d1b19e4a534408a1040ddd313b8596 | [
"MIT"
] | 1,781 | 2015-05-26T23:52:00.000Z | 2022-03-31T19:07:54.000Z | arkane/statmechTest.py | tza0035/RMG-Py | 38c49f7107d1b19e4a534408a1040ddd313b8596 | [
"MIT"
] | 161 | 2015-06-02T14:28:59.000Z | 2022-03-02T19:37:14.000Z | #!/usr/bin/env python3
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | 47.60396 | 120 | 0.56874 |
import os
import unittest
import numpy as np
from rmgpy.species import Species
from rmgpy.exceptions import InputError
from arkane import Arkane
from arkane.ess.qchem import QChemLog
from arkane.modelchem import LevelOfTheory
from arkane.statmech import StatMechJob, determine_rotor_symmetry, is_linear
class Te... | true | true |
1c04c932dba43674d6f47af3886df6fb372135aa | 1,792 | py | Python | scripts_maml/sim_policy.py | jackwilkinson255/mbmpo_master | e9e0eaf542c7895764dcb0bfee28752818124ff2 | [
"MIT"
] | 28 | 2018-11-15T14:14:23.000Z | 2022-01-10T01:53:43.000Z | scripts_maml/sim_policy.py | hongzimao/model_ensemble_meta_learning | 8b1351df94dfe530efaff1118022315c8d877774 | [
"MIT"
] | 3 | 2019-05-05T23:39:01.000Z | 2021-06-15T15:28:06.000Z | scripts_maml/sim_policy.py | hongzimao/model_ensemble_meta_learning | 8b1351df94dfe530efaff1118022315c8d877774 | [
"MIT"
] | 14 | 2018-11-15T16:47:02.000Z | 2021-05-28T14:58:01.000Z | import argparse
import joblib
import tensorflow as tf
from rllab_maml.misc.console import query_yes_no
from rllab_maml.sampler.utils import rollout
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('file', type=str,
help='path to the snapshot file')
... | 38.12766 | 133 | 0.577567 | import argparse
import joblib
import tensorflow as tf
from rllab_maml.misc.console import query_yes_no
from rllab_maml.sampler.utils import rollout
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('file', type=str,
help='path to the snapshot file')
... | true | true |
1c04c979fe151afe9887cd583ced172d0350a9a7 | 3,808 | py | Python | tods/tests/test_ColumnFilter.py | ZhuangweiKang/tods | fe3f55f8ccb306dd292c668e0f1154f1afdfa556 | [
"Apache-2.0"
] | 1 | 2020-11-29T05:50:02.000Z | 2020-11-29T05:50:02.000Z | tods/tests/test_ColumnFilter.py | ZhuangweiKang/tods | fe3f55f8ccb306dd292c668e0f1154f1afdfa556 | [
"Apache-2.0"
] | null | null | null | tods/tests/test_ColumnFilter.py | ZhuangweiKang/tods | fe3f55f8ccb306dd292c668e0f1154f1afdfa556 | [
"Apache-2.0"
] | 1 | 2021-03-26T03:03:28.000Z | 2021-03-26T03:03:28.000Z | import unittest
from d3m import container, utils
from d3m.metadata import base as metadata_base
from tods.data_processing import ColumnFilter
class ColumnFilterTest(unittest.TestCase):
def test_basic(self):
self.maxDiff = None
main = container.DataFrame({'a': [1., 2., 3.], 'b': [2., 3., 4.], 'c':... | 35.588785 | 103 | 0.484244 | import unittest
from d3m import container, utils
from d3m.metadata import base as metadata_base
from tods.data_processing import ColumnFilter
class ColumnFilterTest(unittest.TestCase):
def test_basic(self):
self.maxDiff = None
main = container.DataFrame({'a': [1., 2., 3.], 'b': [2., 3., 4.], 'c':... | true | true |
1c04ca32d627d4d5820847c203b456abb4c58e54 | 14,076 | py | Python | gitlabform/gitlab/projects.py | ep-linden/gitlabform | 3b1b052df5b093928fe003a17e872427e68af687 | [
"MIT"
] | 21 | 2021-12-01T18:32:45.000Z | 2022-02-20T07:29:10.000Z | gitlabform/gitlab/projects.py | ep-linden/gitlabform | 3b1b052df5b093928fe003a17e872427e68af687 | [
"MIT"
] | 48 | 2021-12-01T14:27:41.000Z | 2022-03-28T11:13:43.000Z | gitlabform/gitlab/projects.py | ep-linden/gitlabform | 3b1b052df5b093928fe003a17e872427e68af687 | [
"MIT"
] | 1 | 2022-02-12T00:28:42.000Z | 2022-02-12T00:28:42.000Z | import json
from time import sleep
from gitlabform.gitlab.core import (
GitLabCore,
NotFoundException,
TimeoutWaitingForDeletion,
)
class GitLabProjects(GitLabCore):
def get_project_case_insensitive(self, some_string):
# maybe "foo/bar" is some project's path
try:
# try ... | 35.366834 | 116 | 0.599034 | import json
from time import sleep
from gitlabform.gitlab.core import (
GitLabCore,
NotFoundException,
TimeoutWaitingForDeletion,
)
class GitLabProjects(GitLabCore):
def get_project_case_insensitive(self, some_string):
try:
# try with exact case
return self.g... | true | true |
1c04ca7407b2efa2ddca054e8dd6b9236d773ae1 | 10,644 | py | Python | scripts/Base_Build_Systems/Lighting/light_ardrino.py | UrBudWalt/Active_Building_Model | 5e4c9a208c1ab6d93f658624448488c254e180f1 | [
"MIT"
] | null | null | null | scripts/Base_Build_Systems/Lighting/light_ardrino.py | UrBudWalt/Active_Building_Model | 5e4c9a208c1ab6d93f658624448488c254e180f1 | [
"MIT"
] | null | null | null | scripts/Base_Build_Systems/Lighting/light_ardrino.py | UrBudWalt/Active_Building_Model | 5e4c9a208c1ab6d93f658624448488c254e180f1 | [
"MIT"
] | null | null | null | import time
import pickle
import serial
import datetime
subsystem_ID = "Lights Controller"
relay_dict = {}
filename = 'relay_rooms'
#############################-- Arduino connection --#################################
## This section tries for arduino connection on a specified port ##
##########... | 34.67101 | 136 | 0.456219 | import time
import pickle
import serial
import datetime
subsystem_ID = "Lights Controller"
relay_dict = {}
filename = 'relay_rooms'
try:
arduino = serial.Serial("/dev/cu.usbmodem143101" ,timeout=1)
except:
print("Please check port")
def get_date():
x = datetime.datetime.now()
date = x.strft... | true | true |
1c04cab26ce0118f2c2e10f0fe60b7a1c4d3851a | 7,268 | py | Python | envs/env_registry.py | neevparikh/hierarchical-doom | 082f794b9c6101c4e94f15bf4f93c718ee219ea5 | [
"MIT"
] | 1 | 2021-11-19T19:39:36.000Z | 2021-11-19T19:39:36.000Z | envs/env_registry.py | neevparikh/hierarchical-doom | 082f794b9c6101c4e94f15bf4f93c718ee219ea5 | [
"MIT"
] | null | null | null | envs/env_registry.py | neevparikh/hierarchical-doom | 082f794b9c6101c4e94f15bf4f93c718ee219ea5 | [
"MIT"
] | null | null | null | from utils.utils import log
ENV_REGISTRY = None
class EnvRegistryEntry:
def __init__(self,
env_name_prefix,
make_env_func,
add_extra_params_func=None,
override_default_params_func=None):
self.env_name_prefix = env_name_prefix
sel... | 41.770115 | 122 | 0.70432 | from utils.utils import log
ENV_REGISTRY = None
class EnvRegistryEntry:
def __init__(self,
env_name_prefix,
make_env_func,
add_extra_params_func=None,
override_default_params_func=None):
self.env_name_prefix = env_name_prefix
sel... | true | true |
1c04cac8d97551bb2e086469808fa922385ce908 | 417 | py | Python | ojcrawler/tests/test_get_cf_contest.py | LETTersOnline/OJcrawler | cee55a18dd653d136eacf1ee3d45d59f798e0c4c | [
"MIT"
] | null | null | null | ojcrawler/tests/test_get_cf_contest.py | LETTersOnline/OJcrawler | cee55a18dd653d136eacf1ee3d45d59f798e0c4c | [
"MIT"
] | null | null | null | ojcrawler/tests/test_get_cf_contest.py | LETTersOnline/OJcrawler | cee55a18dd653d136eacf1ee3d45d59f798e0c4c | [
"MIT"
] | null | null | null | import unittest
from ojcrawler.control import Controller
class TestCrawlContest(unittest.TestCase):
def test_something(self):
controller = Controller()
results = controller.get_contest('codeforces', 1221)
self.assertEqual(
results,
['x5281', 'x3781', 'x4455', 'x13... | 21.947368 | 70 | 0.618705 | import unittest
from ojcrawler.control import Controller
class TestCrawlContest(unittest.TestCase):
def test_something(self):
controller = Controller()
results = controller.get_contest('codeforces', 1221)
self.assertEqual(
results,
['x5281', 'x3781', 'x4455', 'x13... | true | true |
1c04cbdee0c3246cf3dd07ebf05dec05475d975b | 1,379 | py | Python | 1-Chapter/htmlcomponents.py | DSandovalFlavio/Dashboards-Plotly-Dash | 58867c2e813bc9273838dec12e7bd15be25504fa | [
"MIT"
] | null | null | null | 1-Chapter/htmlcomponents.py | DSandovalFlavio/Dashboards-Plotly-Dash | 58867c2e813bc9273838dec12e7bd15be25504fa | [
"MIT"
] | null | null | null | 1-Chapter/htmlcomponents.py | DSandovalFlavio/Dashboards-Plotly-Dash | 58867c2e813bc9273838dec12e7bd15be25504fa | [
"MIT"
] | null | null | null | import dash
from dash import html
app = dash.Dash(__name__)
app.layout = html.Div(children=[html.H1('Data Science',
style = {'textAlign': 'center',
'color': '#0FD08D',
'font-size': '... | 55.16 | 175 | 0.354605 | import dash
from dash import html
app = dash.Dash(__name__)
app.layout = html.Div(children=[html.H1('Data Science',
style = {'textAlign': 'center',
'color': '#0FD08D',
'font-size': '... | true | true |
1c04cc252e751ba00dfe3988189b51c215b947a3 | 1,268 | py | Python | inc/dlg_memory_map.py | giwig/qtCheatMotor | 2d59d45dde843ed21a16760ec1fc656aa762ecf4 | [
"MIT"
] | null | null | null | inc/dlg_memory_map.py | giwig/qtCheatMotor | 2d59d45dde843ed21a16760ec1fc656aa762ecf4 | [
"MIT"
] | null | null | null | inc/dlg_memory_map.py | giwig/qtCheatMotor | 2d59d45dde843ed21a16760ec1fc656aa762ecf4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from PyQt5 import QtGui
from PyQt5.QtWidgets import QDialog, QTreeWidgetItem
from inc.process import GWProcess
from ui.memory_map import Ui_dlgMemoryMap
class MemoryMapDialog(QDialog):
proc: GWProcess = None
def __init__(self, parent=None, proc: GWProcess = None):
super(Mem... | 31.7 | 118 | 0.621451 |
from PyQt5 import QtGui
from PyQt5.QtWidgets import QDialog, QTreeWidgetItem
from inc.process import GWProcess
from ui.memory_map import Ui_dlgMemoryMap
class MemoryMapDialog(QDialog):
proc: GWProcess = None
def __init__(self, parent=None, proc: GWProcess = None):
super(MemoryMapDialog, self).__in... | true | true |
1c04cdccc558a193745143e3163139bd9836dc45 | 1,477 | py | Python | insta/templatetags/follow.py | sheillanjoroge/TheatreGram | 02bf3c9dc80717e2b63e2ed7ee8d9dce0e4716d2 | [
"MIT"
] | null | null | null | insta/templatetags/follow.py | sheillanjoroge/TheatreGram | 02bf3c9dc80717e2b63e2ed7ee8d9dce0e4716d2 | [
"MIT"
] | null | null | null | insta/templatetags/follow.py | sheillanjoroge/TheatreGram | 02bf3c9dc80717e2b63e2ed7ee8d9dce0e4716d2 | [
"MIT"
] | null | null | null | from django import template
from django.contrib.auth import get_user_model
import random
from ..models import Profile, Follower
User = get_user_model()
register = template.Library()
@register.simple_tag
def to_follow(user_id):
user = User.objects.get(id = user_id)
user_followers = Follower.objects.filter(us... | 33.568182 | 109 | 0.66283 | from django import template
from django.contrib.auth import get_user_model
import random
from ..models import Profile, Follower
User = get_user_model()
register = template.Library()
@register.simple_tag
def to_follow(user_id):
user = User.objects.get(id = user_id)
user_followers = Follower.objects.filter(us... | true | true |
1c04ce08bc19777febe889083663b0093dd8fd6f | 255 | py | Python | MQ/MQ5.cpp.py | destroyar/micropython-MQ | a9b2c8115daa2b57b15374c60a9960e22ca64730 | [
"Apache-2.0"
] | 10 | 2019-04-16T14:37:46.000Z | 2021-08-31T01:52:52.000Z | MQ/MQ5.cpp.py | destroyar/micropython-MQ | a9b2c8115daa2b57b15374c60a9960e22ca64730 | [
"Apache-2.0"
] | 3 | 2019-02-01T18:49:58.000Z | 2022-02-09T23:05:46.000Z | MQ/MQ5.cpp.py | destroyar/micropython-MQ | a9b2c8115daa2b57b15374c60a9960e22ca64730 | [
"Apache-2.0"
] | 8 | 2019-01-05T12:45:53.000Z | 2022-01-16T22:20:45.000Z | #include "MQ5.h"
MQ5.MQ5(uint8_t pin)
: BaseMQ(pin)
MQ5.MQ5(uint8_t pin, pinHeater)
: BaseMQ(pin, pinHeater)
unsigned long MQ5.readLPG()
return readScaled(-0.39, 1.73)
unsigned long MQ5.readMethane()
return readScaled(-0.38, 1.97)
| 14.166667 | 34 | 0.670588 |
MQ5.MQ5(uint8_t pin)
: BaseMQ(pin)
MQ5.MQ5(uint8_t pin, pinHeater)
: BaseMQ(pin, pinHeater)
unsigned long MQ5.readLPG()
return readScaled(-0.39, 1.73)
unsigned long MQ5.readMethane()
return readScaled(-0.38, 1.97)
| false | true |
1c04ce550077564da87e43f39d97491f69246917 | 5,898 | py | Python | mlir/test/python/dialects/sparse_tensor/test_SpMM.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | null | null | null | mlir/test/python/dialects/sparse_tensor/test_SpMM.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | null | null | null | mlir/test/python/dialects/sparse_tensor/test_SpMM.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | null | null | null | # RUN: SUPPORT_LIB=%mlir_runner_utils_dir/libmlir_c_runner_utils%shlibext %PYTHON %s | FileCheck %s
import ctypes
import numpy as np
import os
import mlir.all_passes_registration
from mlir import ir
from mlir import runtime as rt
from mlir import execution_engine
from mlir import passmanager
from mlir.dialects impo... | 33.702857 | 99 | 0.665649 |
import ctypes
import numpy as np
import os
import mlir.all_passes_registration
from mlir import ir
from mlir import runtime as rt
from mlir import execution_engine
from mlir import passmanager
from mlir.dialects import sparse_tensor as st
from mlir.dialects import builtin
from mlir.dialects.linalg.opdsl import lang... | true | true |
1c04ce820a802a38606e3651691ce2e4503ab8da | 4,888 | py | Python | castspot_project/settings.py | marcphilippebeaujean-abertay/castspot | c39c230161091380b2a1b3612a8a2e52f414ea72 | [
"MIT"
] | null | null | null | castspot_project/settings.py | marcphilippebeaujean-abertay/castspot | c39c230161091380b2a1b3612a8a2e52f414ea72 | [
"MIT"
] | null | null | null | castspot_project/settings.py | marcphilippebeaujean-abertay/castspot | c39c230161091380b2a1b3612a8a2e52f414ea72 | [
"MIT"
] | null | null | null | import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ.get('SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in p... | 30.936709 | 143 | 0.680646 | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.environ.get('SECRET_KEY')
DEBUG = True if os.environ.get('IS_PROD') == 'FALSE' else False
ALLOWED_HOSTS = ['*'] if os.environ.get('IS_PROD') == 'FALSE' else ['castspot.onrender.com',
... | true | true |
1c04d0a078b6fa779c579e6befa06a62076cb9de | 778 | py | Python | python/src/cryptopals/set5/challenge33.py | ocirne/cryptopals | 3835bbeef3e521d48814795b94d426139918b9cd | [
"Unlicense"
] | 1 | 2021-02-20T16:38:25.000Z | 2021-02-20T16:38:25.000Z | python/src/cryptopals/set5/challenge33.py | ocirne/cryptopals | 3835bbeef3e521d48814795b94d426139918b9cd | [
"Unlicense"
] | null | null | null | python/src/cryptopals/set5/challenge33.py | ocirne/cryptopals | 3835bbeef3e521d48814795b94d426139918b9cd | [
"Unlicense"
] | null | null | null | import random
def challenge33(p, g):
a = random.randrange(0, p)
b = random.randrange(0, p)
A = pow(g, a, p)
B = pow(g, b, p)
s = pow(B, a, p)
r = pow(A, b, p)
assert s == r
return s
p1, g1 = 37, 5
p2 = int(
"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024"
"e088a67cc740... | 23.575758 | 59 | 0.714653 | import random
def challenge33(p, g):
a = random.randrange(0, p)
b = random.randrange(0, p)
A = pow(g, a, p)
B = pow(g, b, p)
s = pow(B, a, p)
r = pow(A, b, p)
assert s == r
return s
p1, g1 = 37, 5
p2 = int(
"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024"
"e088a67cc740... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.