hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5108e36e1b24e0722a49cfe5996dd84987d18722 | 1,337 | py | Python | ex105.py | ArthurCorrea/python-exercises | 0c2ac46b8c40dd9868b132e847cfa42e025095e3 | [
"MIT"
] | null | null | null | ex105.py | ArthurCorrea/python-exercises | 0c2ac46b8c40dd9868b132e847cfa42e025095e3 | [
"MIT"
] | null | null | null | ex105.py | ArthurCorrea/python-exercises | 0c2ac46b8c40dd9868b132e847cfa42e025095e3 | [
"MIT"
] | null | null | null | # Faa um programa que tenha um funo notas() que pode receber vrias
# notas de alunos e vai retornar um dicionrio com as seguintes informaes:
# - Quantidade de notas;
# - A maior nota;
# - A menor nota;
# - A mdia da turma;
# - A situao(opcional);
# Adicione tambm as docstrings da funo.
def notas(show=False):
"""
... | 27.854167 | 84 | 0.554226 | # Faça um programa que tenha um função notas() que pode receber várias
# notas de alunos e vai retornar um dicionário com as seguintes informações:
# - Quantidade de notas;
# - A maior nota;
# - A menor nota;
# - A média da turma;
# - A situação(opcional);
# Adicione também as docstrings da função.
def notas(show=Fal... | 50 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
78baa060484aee5b5791c697ecb50180a17dcae1 | 15,613 | py | Python | core/models/group.py | agolibroda/PyTorWiki | 678a2ae13d0027c61af36e61b72e4e54493a29ac | [
"Apache-2.0"
] | null | null | null | core/models/group.py | agolibroda/PyTorWiki | 678a2ae13d0027c61af36e61b72e4e54493a29ac | [
"Apache-2.0"
] | null | null | null | core/models/group.py | agolibroda/PyTorWiki | 678a2ae13d0027c61af36e61b72e4e54493a29ac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
#
# Copyright 2016 Alec Goliboda
#
# group.py
from __future__ import print_function
# import markdown
# import pymysql
# from _overlapped import NULL
##############
from .. import WikiException
# from core.models.template import Templat... | 40.343669 | 193 | 0.547172 | #!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
#
# Copyright 2016 Alec Goliboda
#
# group.py
from __future__ import print_function
import logging
import json
import zlib
# import markdown
from datetime import datetime
import tornado.options
# import pymysql
import hashlib
import bcrypt
i... | 4,704 | 0 | 0 | 12,575 | 0 | 0 | 0 | 14 | 341 |
70b6c80341def36320aeb56eea498bea8fda840e | 4,327 | py | Python | spug_api/libs/parser.py | atompi/spug | 88ebd46e47c88731b40cb82a6c7a360511b703fa | [
"MIT"
] | null | null | null | spug_api/libs/parser.py | atompi/spug | 88ebd46e47c88731b40cb82a6c7a360511b703fa | [
"MIT"
] | null | null | null | spug_api/libs/parser.py | atompi/spug | 88ebd46e47c88731b40cb82a6c7a360511b703fa | [
"MIT"
] | null | null | null | # Copyright: (c) OpenSpug Organization. https://github.com/openspug/spug
# Copyright: (c) <spug.dev@gmail.com>
# Released under the AGPL-3.0 License.
#
#
#
# Json
| 33.030534 | 105 | 0.554657 | # Copyright: (c) OpenSpug Organization. https://github.com/openspug/spug
# Copyright: (c) <spug.dev@gmail.com>
# Released under the AGPL-3.0 License.
import json
from .utils import AttrDict
# 自定义的解析异常
class ParseError(BaseException):
def __init__(self, message):
self.message = message
# 需要校验的参数对象
class... | 75 | 0 | 0 | 3,999 | 0 | 0 | 0 | -4 | 133 |
ca3c214980bb966e02bee0584e6a700a068fc2b7 | 3,954 | py | Python | mBugTranslations/Chrome.py | SkyLined/mBugId | 781bfe9a120e55630a91ce1e86b39ad0dee031ec | [
"CC-BY-4.0"
] | 22 | 2016-08-11T14:50:55.000Z | 2021-06-06T09:39:26.000Z | mBugTranslations/Chrome.py | SkyLined/mBugId | 781bfe9a120e55630a91ce1e86b39ad0dee031ec | [
"CC-BY-4.0"
] | 19 | 2016-09-07T05:54:40.000Z | 2020-07-02T07:46:38.000Z | mBugTranslations/Chrome.py | SkyLined/mBugId | 781bfe9a120e55630a91ce1e86b39ad0dee031ec | [
"CC-BY-4.0"
] | 11 | 2016-09-03T22:42:50.000Z | 2018-10-01T18:28:59.000Z | from .cBugTranslation import cBugTranslation;
aoBugTranslations = [
# ASan build related -> Ignored
cBugTranslation(
azs0rbAdditionalIrrelevantStackFrameSymbols = [
rb".*!`anonymous namespace'::Create", # Part of skia
rb".*!base::debug::BreakDebugger",
rb".*!base::debug::CollectGDIUsageAndDie... | 40.762887 | 151 | 0.686899 | import re;
from .cBugTranslation import cBugTranslation;
aoBugTranslations = [
# ASan build related -> Ignored
cBugTranslation(
azs0rbAdditionalIrrelevantStackFrameSymbols = [
rb".*!`anonymous namespace'::Create", # Part of skia
rb".*!base::debug::BreakDebugger",
rb".*!base::debug::CollectGDI... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 23 |
f7b84e0119a5bb7d3e69b3fc77fd9952daf83b18 | 2,975 | py | Python | ProjetoMercado/mercado/models.py | LucasRodriguesDaPaixao/ProjetoMercado | 7a086ab0af800b15ef090520c9c81a0cd83dd650 | [
"MIT"
] | null | null | null | ProjetoMercado/mercado/models.py | LucasRodriguesDaPaixao/ProjetoMercado | 7a086ab0af800b15ef090520c9c81a0cd83dd650 | [
"MIT"
] | null | null | null | ProjetoMercado/mercado/models.py | LucasRodriguesDaPaixao/ProjetoMercado | 7a086ab0af800b15ef090520c9c81a0cd83dd650 | [
"MIT"
] | null | null | null |
# Create your models here.
| 33.806818 | 103 | 0.736807 | from django.db import models
# Create your models here.
class Cliente(models.Model):
ID_cliente = models.AutoField(primary_key=True)
nome_cliente = models.CharField(max_length=100, verbose_name="Nome:")
cpf = models.CharField(max_length=14, verbose_name="CPF:")
def __str__(self):
return self.... | 2 | 0 | 0 | 2,744 | 0 | 0 | 0 | 7 | 182 |
e682d03323f99fc860ddd405e81e02079d38b903 | 2,979 | py | Python | macrokit/_validator.py | hanjinliu/macro-kit | 61ebc38ea1086337d5a7477c6e896af0220f8a71 | [
"BSD-3-Clause"
] | 2 | 2021-11-02T09:53:49.000Z | 2021-11-10T10:33:05.000Z | macrokit/_validator.py | hanjinliu/macro-kit | 61ebc38ea1086337d5a7477c6e896af0220f8a71 | [
"BSD-3-Clause"
] | null | null | null | macrokit/_validator.py | hanjinliu/macro-kit | 61ebc38ea1086337d5a7477c6e896af0220f8a71 | [
"BSD-3-Clause"
] | null | null | null | from typing import Hashable, TypeVar
_T = TypeVar("_T", bound=Hashable)
_A = TypeVar("_A")
validator = Validator()
| 22.568182 | 75 | 0.627727 | from typing import Callable, Hashable, TypeVar, Iterable, Union
from ._symbol import Symbol
from .head import Head
_T = TypeVar("_T", bound=Hashable)
_A = TypeVar("_A")
class Validator:
"""A validator class that will be used for Expr argument validation."""
def __init__(self):
self._map: dict[_T, Ca... | 0 | 1,745 | 0 | 774 | 0 | 0 | 0 | 34 | 297 |
2dcc5057b0af83ae887869fbadf0b60476028183 | 7,579 | py | Python | cubi_tk/archive/readme.py | eudesbarbosa/cubi-tk | 80c3ef9387f2399f796b2cc445b99781d541f222 | [
"MIT"
] | null | null | null | cubi_tk/archive/readme.py | eudesbarbosa/cubi-tk | 80c3ef9387f2399f796b2cc445b99781d541f222 | [
"MIT"
] | null | null | null | cubi_tk/archive/readme.py | eudesbarbosa/cubi-tk | 80c3ef9387f2399f796b2cc445b99781d541f222 | [
"MIT"
] | null | null | null | """``cubi-tk archive prepare``: Prepare a project for archival"""
import os
import re
from ..isa_tpl import IsaTabTemplate
from ..isa_tpl import load_variables
_BASE_DIR = os.path.dirname(__file__)
TEMPLATE = IsaTabTemplate(
name="archive",
path=os.path.join(os.path.dirname(_BASE_DIR), "isa_tpl", "archive"),
... | 34.766055 | 98 | 0.577517 | """``cubi-tk archive prepare``: Prepare a project for archival"""
import errno
import os
import re
import shutil
import sys
import tempfile
from cookiecutter.main import cookiecutter
from logzero import logger
from ..common import execute_shell_commands
from ..isa_tpl import IsaTabTemplate
from ..isa_tpl import load... | 0 | 0 | 0 | 0 | 0 | 5,266 | 0 | 14 | 341 |
769fc816a6040cc61dab6376c20fd5c6bf0ebaa0 | 989 | py | Python | sigmod2021-exdra-p523/experiments/archive/submitted_results/code/other/pca.py | damslab/reproducibility | f7804b2513859f7e6f14fa7842d81003d0758bf8 | [
"Apache-2.0"
] | 4 | 2021-12-10T17:20:26.000Z | 2021-12-27T14:38:40.000Z | sigmod2021-exdra-p523/experiments/code/other/pca.py | damslab/reproducibility | f7804b2513859f7e6f14fa7842d81003d0758bf8 | [
"Apache-2.0"
] | null | null | null | sigmod2021-exdra-p523/experiments/code/other/pca.py | damslab/reproducibility | f7804b2513859f7e6f14fa7842d81003d0758bf8 | [
"Apache-2.0"
] | null | null | null |
import numpy as np
import argparse
from sklearn.decomposition import PCA
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
parser = argparse.ArgumentParser()
parser.add_argument('-x', '--datapath', type=str, required=True)
parser.add_argument('-y', '--labels', type=str, requ... | 43 | 118 | 0.781598 |
import numpy as np
import argparse
from sklearn.decomposition import PCA
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
parser = argparse.ArgumentParser()
parser.add_argument('-x', '--datapath', type=str, required=True)
parser.add_argument('-y', '--labels', type=str, requ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ac1fa224c6f4611660c583d6666d2a339221dfa7 | 8,868 | py | Python | prototypes/learn_weigths.py | pantelisantonoudiou/Logic_szrDetect | 3267cabc78905c189a97e06ea2731b6f9e7b2def | [
"Apache-2.0"
] | 1 | 2020-11-19T19:26:34.000Z | 2020-11-19T19:26:34.000Z | prototypes/learn_weigths.py | pantelisantonoudiou/Logic_szrDetect | 3267cabc78905c189a97e06ea2731b6f9e7b2def | [
"Apache-2.0"
] | null | null | null | prototypes/learn_weigths.py | pantelisantonoudiou/Logic_szrDetect | 3267cabc78905c189a97e06ea2731b6f9e7b2def | [
"Apache-2.0"
] | 1 | 2021-04-07T11:41:39.000Z | 2021-04-07T11:41:39.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 13 09:14:32 2020
@author: Pante
"""
import features
import numpy as np
from sklearn.preprocessing import StandardScaler
from array_helper import find_szr_idx, match_szrs, merge_close
from build_feature_data import get_data, get_features_allch
####### consider isolation ... | 27.974763 | 141 | 0.614005 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 13 09:14:32 2020
@author: Pante
"""
import os, features, time
import numpy as np
from sklearn.preprocessing import StandardScaler
from array_helper import find_szr_idx, match_szrs, merge_close
from build_feature_data import get_data, get_features_allch
from sklearn.metric... | 0 | 0 | 0 | 0 | 0 | 2,799 | 0 | 48 | 98 |
276b5d3d63f7139687164c5d10374d92ac764ed2 | 1,016 | py | Python | qcloudsdkcmem/DescribeCmemRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkcmem/DescribeCmemRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkcmem/DescribeCmemRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
| 25.4 | 73 | 0.643701 | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class DescribeCmemRequest(Request):
def __init__(self):
super(DescribeCmemRequest, self).__init__(
'cmem', 'qcloudcliV1', 'DescribeCmem', 'cmem.api.qcloud.com')
def get_limit(self):
return self.get_params().get('li... | 0 | 0 | 0 | 926 | 0 | 0 | 0 | 20 | 46 |
a06cceb6d9e57c9f8d1381b5bcfd1fa628bd0789 | 2,314 | py | Python | rssnewsbot/spiders/rssspider.py | hijoe320/RSSBot | cbc0bc24d980ede3419111d51384abbc2c93f70c | [
"MIT"
] | null | null | null | rssnewsbot/spiders/rssspider.py | hijoe320/RSSBot | cbc0bc24d980ede3419111d51384abbc2c93f70c | [
"MIT"
] | null | null | null | rssnewsbot/spiders/rssspider.py | hijoe320/RSSBot | cbc0bc24d980ede3419111d51384abbc2c93f70c | [
"MIT"
] | null | null | null | from time import mktime
import xxhash
def hs(s):
"""
hash function to convert url to fixed length hash code
"""
return xxhash.xxh32(s).hexdigest()
def time2ts(time_struct):
"""
convert time_struct to epoch
"""
return mktime(time_struct)
| 32.138889 | 103 | 0.617978 | from time import sleep, gmtime, mktime
from datetime import datetime
import logging
import scrapy
import redis
import msgpack
import xxhash
import pymongo as pm
import feedparser as fp
from colorama import Back, Fore, Style
from ..settings import MONGODB_URI, REDIS_HOST, REDIS_PORT, REDIS_PWD, REDIS_PENDING_QUEUE
def... | 0 | 0 | 0 | 1,740 | 0 | 0 | 0 | 79 | 221 |
0a29357a3fcb65eb38130117fd1af6fb06bc1c40 | 11,992 | py | Python | data/transforms/data_preprocessing.py | zyxwvu321/Classifer_SSL_Longtail | e6c09414c49e695b0f4221a3c6245ae3929a1788 | [
"MIT"
] | null | null | null | data/transforms/data_preprocessing.py | zyxwvu321/Classifer_SSL_Longtail | e6c09414c49e695b0f4221a3c6245ae3929a1788 | [
"MIT"
] | null | null | null | data/transforms/data_preprocessing.py | zyxwvu321/Classifer_SSL_Longtail | e6c09414c49e695b0f4221a3c6245ae3929a1788 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 8 15:36:15 2020
dataset transform
@author: minjie
"""
# imgs = []
# pts = []
#
# hh,ww,_ = img.shape
# for _ in range(self.n_aug):
# #points = [ww/2.0,hh/2.0,1... | 38.935065 | 162 | 0.488075 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 8 15:36:15 2020
dataset transform
@author: minjie
"""
import albumentations as A
from albumentations.pytorch import ToTensor as ToTensor_albu
import cv2
import torch
from multiprocessing import Pool
from utils.parse_meta import parse_kpds
import ... | 0 | 0 | 0 | 10,462 | 0 | 181 | 0 | 50 | 271 |
22a8e0eda2fca9bf48bd5895ab01712afaaf9054 | 265 | py | Python | Python/leetcode/HIndexIi.py | darrencheng0817/AlgorithmLearning | aec1ddd0c51b619c1bae1e05f940d9ed587aa82f | [
"MIT"
] | 2 | 2015-12-02T06:44:01.000Z | 2016-05-04T21:40:54.000Z | Python/leetcode/HIndexIi.py | darrencheng0817/AlgorithmLearning | aec1ddd0c51b619c1bae1e05f940d9ed587aa82f | [
"MIT"
] | null | null | null | Python/leetcode/HIndexIi.py | darrencheng0817/AlgorithmLearning | aec1ddd0c51b619c1bae1e05f940d9ed587aa82f | [
"MIT"
] | null | null | null | '''
Created on 1.12.2016
@author: Darren
''''''
Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm?
Expected runtime complexity is in O(log n) and the input is sorted.
"
'''
| 18.928571 | 117 | 0.656604 | '''
Created on 1.12.2016
@author: Darren
''''''
Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm?
Expected runtime complexity is in O(log n) and the input is sorted.
"
'''
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c6d3edd93fcde8345da8ce9f04c85393e6bb98d8 | 5,516 | py | Python | HW1/hw1/code/visual_recog.py | jiansfoggy/16-720B | 6395555449fa297f19efb42970e480f1b382e38a | [
"Unlicense"
] | 2 | 2020-03-31T15:54:49.000Z | 2022-01-07T13:43:46.000Z | HW1/hw1/code/visual_recog.py | jiansfoggy/16-720B | 6395555449fa297f19efb42970e480f1b382e38a | [
"Unlicense"
] | null | null | null | HW1/hw1/code/visual_recog.py | jiansfoggy/16-720B | 6395555449fa297f19efb42970e480f1b382e38a | [
"Unlicense"
] | 4 | 2019-09-10T00:48:11.000Z | 2022-01-07T13:43:50.000Z | import numpy as np
import imageio
import visual_words
import multiprocessing as mp
def build_recognition_system(num_workers=2):
'''
Creates a trained recognition system by generating training features from all training images.
[input]
* num_workers: number of workers to process in parallel
[saved]
... | 28.729167 | 143 | 0.701051 | import numpy as np
import threading
import queue
import imageio
import os,time
import math
import visual_words
import multiprocessing as mp
def build_recognition_system(num_workers=2):
'''
Creates a trained recognition system by generating training features from all training images.
[input]
* num_wo... | 0 | 0 | 0 | 0 | 0 | 236 | 0 | -31 | 117 |
076663290b2821e6423b989415d2957ab3b21b81 | 441 | py | Python | app/__init__.py | SalesAppi/JPSSM_topics | 6be32fca31e5e15f51753101a222a08fd2013f9b | [
"MIT"
] | 1 | 2022-03-01T08:15:28.000Z | 2022-03-01T08:15:28.000Z | app/__init__.py | SalesAppi/JPSSM_topics | 6be32fca31e5e15f51753101a222a08fd2013f9b | [
"MIT"
] | null | null | null | app/__init__.py | SalesAppi/JPSSM_topics | 6be32fca31e5e15f51753101a222a08fd2013f9b | [
"MIT"
] | 1 | 2020-12-14T05:00:28.000Z | 2020-12-14T05:00:28.000Z | from flask import Flask
#from nltk.tokenize import RegexpTokenizer
#from nltk import stem
#from nltk.stem import WordNetLemmatizer
app = Flask(__name__) | 19.173913 | 42 | 0.825397 | from flask import Flask
import gensim
import re
from gensim.models import LdaModel
from gensim.test.utils import datapath
from gensim import corpora, models
from gensim.corpora import Dictionary
from re import sub
import os
import string
import codecs
import nltk
#from nltk.tokenize import RegexpTokenizer
#from nlt... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 290 |
f6c6564e121ddf8a7df728a398f2d1498dea1117 | 7,942 | py | Python | tables.py | arunext/greffy | 001a0b94428629b9cdfaa8966f3cf6cd6f349e8a | [
"Apache-2.0"
] | null | null | null | tables.py | arunext/greffy | 001a0b94428629b9cdfaa8966f3cf6cd6f349e8a | [
"Apache-2.0"
] | null | null | null | tables.py | arunext/greffy | 001a0b94428629b9cdfaa8966f3cf6cd6f349e8a | [
"Apache-2.0"
] | null | null | null | import psycopg2
from config import config
import datetime
from textblob import TextBlob
import nltk
from nltk.corpus import stopwords
def create_tables():
""" create tables in the PostgreSQL database"""
params = config()
# connect to the PostgreSQL server
conn = psycopg2.connect(**params)
cur = c... | 27.013605 | 157 | 0.629816 | import psycopg2
from config import config
import datetime
from textblob import TextBlob
import nltk
from nltk.corpus import stopwords
def create_tables():
""" create tables in the PostgreSQL database"""
params = config()
# connect to the PostgreSQL server
conn = psycopg2.connect(**params)
cur = c... | 0 | 0 | 0 | 0 | 0 | 2,434 | 0 | 0 | 69 |
2f1c4753ac08df358bf6226a60a7c9bda64e76e2 | 950 | py | Python | weltgeist/units.py | samgeen/Weltgeist | c7d52e879bb3473cecbb06651b5e76dac3020da6 | [
"MIT"
] | null | null | null | weltgeist/units.py | samgeen/Weltgeist | c7d52e879bb3473cecbb06651b5e76dac3020da6 | [
"MIT"
] | null | null | null | weltgeist/units.py | samgeen/Weltgeist | c7d52e879bb3473cecbb06651b5e76dac3020da6 | [
"MIT"
] | null | null | null | """
Defined code units and physical quantities
The Python parts of Weltgeist use cgs
VH1 uses units defined below
Sam Geen, February 2018
"""
import numpy as np
# Physical quantities (base units in cgs)
pc = 3.086e+18
mH = 1.66e-24
year = 3.154e+7
Myr = 1e6*year
kB = 1.3806485279e-16 # in cgs
G = 6.674... | 26.388889 | 85 | 0.663158 | """
Defined code units and physical quantities
The Python parts of Weltgeist use cgs
VH1 uses units defined below
Sam Geen, February 2018
"""
import numpy as np
# Physical quantities (base units in cgs)
pc = 3.086e+18
mH = 1.66e-24
year = 3.154e+7
Myr = 1e6*year
kB = 1.3806485279e-16 # in cgs
G = 6.674... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ca8b1afb26f13038161c24aead09569f01b99768 | 9,456 | py | Python | olwidget/widgets.py | jj0hns0n/mednet | efb6681292e7ac8f870ee5967a5a2b352853ae35 | [
"BSD-3-Clause"
] | 2 | 2016-02-18T01:06:04.000Z | 2016-02-18T03:53:37.000Z | olwidget/widgets.py | jj0hns0n/mednet | efb6681292e7ac8f870ee5967a5a2b352853ae35 | [
"BSD-3-Clause"
] | null | null | null | olwidget/widgets.py | jj0hns0n/mednet | efb6681292e7ac8f870ee5967a5a2b352853ae35 | [
"BSD-3-Clause"
] | null | null | null | import re
from django.contrib.gis.gdal import OGRGeometry
from django.contrib.gis.geos import GEOSGeometry
from django.conf import settings
# Default settings for paths and API URLs. These can all be overridden by
# specifying a value in settings.py
api_defaults = {
'GOOGLE_API_KEY': "",
'YAHOO_APP_ID':... | 32.273038 | 88 | 0.602792 | import re
from django.contrib.gis.gdal import OGRException, OGRGeometry
from django.contrib.gis.geos import GEOSGeometry
from django.forms.widgets import Textarea
from django.template.loader import render_to_string
from django.utils import simplejson
from django.conf import settings
from django import forms
def reduc... | 0 | 0 | 0 | 5,961 | 0 | 539 | 0 | 81 | 272 |
a777c1f7cbe7e6ff795a3c5c9391e45397c000e0 | 921 | py | Python | advent/year2021/day1.py | davweb/advent-of-code | 6d9ac52092f4aad26a84d7cfd2fcd8420f1ea612 | [
"Unlicense"
] | null | null | null | advent/year2021/day1.py | davweb/advent-of-code | 6d9ac52092f4aad26a84d7cfd2fcd8420f1ea612 | [
"Unlicense"
] | null | null | null | advent/year2021/day1.py | davweb/advent-of-code | 6d9ac52092f4aad26a84d7cfd2fcd8420f1ea612 | [
"Unlicense"
] | null | null | null | #!/usr/local/bin/python3
def part1(data):
"""
>>> part1([199, 200, 208, 210, 200, 207, 240, 269, 260, 263])
7
>>> part1(read_input())
1581
"""
previous = data[0]
count = 0
for value in data[1:]:
if value > previous:
count += 1
previous = value
re... | 16.745455 | 65 | 0.512486 | #!/usr/local/bin/python3
def read_input():
file = open('input/2021/day1-input.txt', 'r')
return [int(line) for line in file.readlines()]
def part1(data):
"""
>>> part1([199, 200, 208, 210, 200, 207, 240, 269, 260, 263])
7
>>> part1(read_input())
1581
"""
previous = data[0]
co... | 0 | 0 | 0 | 0 | 0 | 158 | 0 | 0 | 46 |
ac3978d7b01ad6d6e0f32900633722a103fd5b2e | 4,738 | py | Python | Example/Gutenkunst2007/Lee_2003/LeeNet.py | bcdaniels/SloppyCell | 17e68127a6aba19056a5067748a2d18241cc4d76 | [
"BSD-3-Clause"
] | 2 | 2020-05-26T19:29:39.000Z | 2020-08-26T20:54:52.000Z | Example/Gutenkunst2007/Lee_2003/LeeNet.py | bcdaniels/SloppyCell | 17e68127a6aba19056a5067748a2d18241cc4d76 | [
"BSD-3-Clause"
] | 1 | 2019-04-15T21:08:12.000Z | 2019-04-15T21:08:12.000Z | Example/Gutenkunst2007/Lee_2003/LeeNet.py | jurquiza/SloppyCellUrquiza2019 | a9f64d9d4172c82735813f09e48f36777a714e9c | [
"BSD-3-Clause"
] | 3 | 2017-09-12T03:12:01.000Z | 2018-10-19T11:08:09.000Z |
net = Network('Lee2003')
net.add_compartment('extract')
net.add_parameter('Dsh0', 100, name = r'Dsh^0')
net.add_parameter('APC0', 100, name = r'APC^0')
net.add_parameter('TCF0', 15, name = r'TCF^0')
net.add_parameter('GSK0', 50, name = r'GSK^0')
net.add_species('X2', 'extract', 0)#, name=r'Dsh_a')
net.add_species('... | 41.561404 | 105 | 0.657239 | from SloppyCell.ReactionNetworks import *
net = Network('Lee2003')
net.add_compartment('extract')
net.add_parameter('Dsh0', 100, name = r'Dsh^0')
net.add_parameter('APC0', 100, name = r'APC^0')
net.add_parameter('TCF0', 15, name = r'TCF^0')
net.add_parameter('GSK0', 50, name = r'GSK^0')
net.add_species('X2', 'extra... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 22 |
07f3349c9a417036cdc8776d53fcfa52d2e1af80 | 5,082 | py | Python | PWGJE/EMCALJetTasks/Tracks/analysis/util/Interpolator.py | maroozm/AliPhysics | 22ec256928cfdf8f800e05bfc1a6e124d90b6eaf | [
"BSD-3-Clause"
] | 114 | 2017-03-03T09:12:23.000Z | 2022-03-03T20:29:42.000Z | PWGJE/EMCALJetTasks/Tracks/analysis/util/Interpolator.py | maroozm/AliPhysics | 22ec256928cfdf8f800e05bfc1a6e124d90b6eaf | [
"BSD-3-Clause"
] | 19,637 | 2017-01-16T12:34:41.000Z | 2022-03-31T22:02:40.000Z | PWGJE/EMCALJetTasks/Tracks/analysis/util/Interpolator.py | maroozm/AliPhysics | 22ec256928cfdf8f800e05bfc1a6e124d90b6eaf | [
"BSD-3-Clause"
] | 1,021 | 2016-07-14T22:41:16.000Z | 2022-03-31T05:15:51.000Z | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | 37.925373 | 123 | 0.538764 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | 0 | 0 | 0 | 3,791 | 0 | 0 | 0 | -10 | 45 |
0b9bc42aab3a61dc776c20fde1b7be088ba0e2b2 | 2,276 | py | Python | creator/schema.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | 3 | 2019-05-04T02:07:28.000Z | 2020-10-16T17:47:44.000Z | creator/schema.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | 604 | 2019-02-21T18:14:51.000Z | 2022-02-10T08:13:54.000Z | creator/schema.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | null | null | null | """
This is the root schema definition that combines individual applications'
schemas into one.
Each application that has queries or mutations exports them as either Query
or Mutation from the application's schema module.
No resolvers or type definitions should be included here.
"""
import graphene
import creator.anal... | 29.947368 | 75 | 0.773726 | """
This is the root schema definition that combines individual applications'
schemas into one.
Each application that has queries or mutations exports them as either Query
or Mutation from the application's schema module.
No resolvers or type definitions should be included here.
"""
import graphene
from django.conf imp... | 0 | 0 | 0 | 1,390 | 0 | 0 | 0 | 26 | 90 |
eebaa5aaa5d495d9ab50fc4d5c37d590c86b3096 | 9,624 | py | Python | simulation/simulation.py | bopopescu/sparrow-mod | 56c601ee3dd852a9f053bffffc2a52ff3da8d2bd | [
"Apache-2.0"
] | 200 | 2015-01-05T07:37:20.000Z | 2022-03-30T03:28:21.000Z | simulation/simulation.py | bopopescu/sparrow-mod | 56c601ee3dd852a9f053bffffc2a52ff3da8d2bd | [
"Apache-2.0"
] | 1 | 2016-05-13T10:46:32.000Z | 2016-05-13T10:46:32.000Z | simulation/simulation.py | bopopescu/sparrow-mod | 56c601ee3dd852a9f053bffffc2a52ff3da8d2bd | [
"Apache-2.0"
] | 73 | 2015-01-06T02:00:17.000Z | 2021-11-22T10:04:03.000Z | #
# Copyright 2013 The Regents of The University California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 40.779661 | 115 | 0.641209 | #
# Copyright 2013 The Regents of The University California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 0 | 0 | 0 | 7,905 | 0 | 608 | 0 | -25 | 363 |
eb0cc8b93b8223d65f24aaccba78c888502d04df | 892 | py | Python | 2015/MAC0327/Desafios 2/p11.py | andredalton/bcc | 188190e436615e2344d87b722856fa02e6eec9cc | [
"Apache-2.0"
] | 1 | 2018-08-02T14:09:26.000Z | 2018-08-02T14:09:26.000Z | 2015/MAC0327/Desafios 2/p11.py | andredalton/bcc | 188190e436615e2344d87b722856fa02e6eec9cc | [
"Apache-2.0"
] | null | null | null | 2015/MAC0327/Desafios 2/p11.py | andredalton/bcc | 188190e436615e2344d87b722856fa02e6eec9cc | [
"Apache-2.0"
] | 1 | 2020-07-13T04:27:02.000Z | 2020-07-13T04:27:02.000Z | # coding=utf-8
__author__ = 'Andr Meneghelli'
"""
/*******************************************************************************
* Aluno: Andr Meneghelli Vale, Nm. USP: 4898948
* Curso: Bacharelado em Cincias da Computao
* Aula 13 - Stone Pile
* MAC0327 -- IME/USP, -- Prof. Cristina Gomes Fernandes
******... | 22.3 | 80 | 0.48991 | # coding=utf-8
__author__ = 'André Meneghelli'
"""
/*******************************************************************************
* Aluno: André Meneghelli Vale, Núm. USP: 4898948
* Curso: Bacharelado em Ciências da Computação
* Aula 13 - Stone Pile
* MAC0327 -- IME/USP, -- Prof. Cristina Gomes Fernandes
... | 12 | 0 | 0 | 0 | 0 | 389 | 0 | 0 | 46 |
cd67696b0ec1ee40fb689af2c3c02ad3ecc6be4e | 5,014 | py | Python | model.py | abhitrip/Behavioral-Cloning | 9930dc7fc2e6623954f84859b7d011905cd48d30 | [
"MIT"
] | null | null | null | model.py | abhitrip/Behavioral-Cloning | 9930dc7fc2e6623954f84859b7d011905cd48d30 | [
"MIT"
] | null | null | null | model.py | abhitrip/Behavioral-Cloning | 9930dc7fc2e6623954f84859b7d011905cd48d30 | [
"MIT"
] | null | null | null | import matplotlib.image as mpimg
"""
To show the preprocessing for final model
"""
batch_size = 128
# define model
"""
model = nvidia_model()
model.compile(optimizer='adam', loss='mse', metrics=['accuracy'])
model.summary()
# train model
model.fit_generator(read_data_gen(batch_size), samples_per_epoch=8000... | 25.451777 | 89 | 0.632429 | import csv
import matplotlib.image as mpimg
import pickle
import numpy as np
from keras.models import Sequential
from keras.layers.core import Flatten,Lambda,Dense
from keras.layers.convolutional import Cropping2D,Conv2D
from keras import backend as K
from keras.layers.core import Activation
import matplotlib.image a... | 0 | 0 | 0 | 0 | 1,002 | 3,085 | 0 | 94 | 425 |
43ba3750ab55b89ed9e0505f5404d4b28171dd33 | 1,647 | py | Python | src/downward/experiments/issue739/v5-translate.py | ScarfZapdos/conan-bge-questgen | 4d184c5bf0ae4b768b8043cec586395df9ce1451 | [
"MIT"
] | 1 | 2021-09-09T13:03:02.000Z | 2021-09-09T13:03:02.000Z | src/downward/experiments/issue739/v5-translate.py | ScarfZapdos/conan-bge-questgen | 4d184c5bf0ae4b768b8043cec586395df9ce1451 | [
"MIT"
] | null | null | null | src/downward/experiments/issue739/v5-translate.py | ScarfZapdos/conan-bge-questgen | 4d184c5bf0ae4b768b8043cec586395df9ce1451 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
from lab.environments import LocalEnvironment, BaselSlurmEnvironment
import common_setup
from common_setup import IssueConfig, IssueExperiment
DIR = os.path.dirname(os.path.abspath(__file__))
BENCHMARKS_DIR = os.environ["DOWNWARD_BENCHMARKS"]
REVISIONS = ["is... | 35.042553 | 178 | 0.756527 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
from lab.environments import LocalEnvironment, BaselSlurmEnvironment
import common_setup
from common_setup import IssueConfig, IssueExperiment
from relativescatter import RelativeScatterPlotReport
DIR = os.path.dirname(os.path.abspath(__file__))
BENCHMARKS_DI... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 32 | 22 |
6ba0b5003d4c97df676dbfc10dff603b15cd48d9 | 506 | py | Python | mplscience/__init__.py | adamgayoso/mpscience | 0401ded920a4d09314e9a747cf4da07d17a60a05 | [
"MIT"
] | 4 | 2021-07-15T16:55:24.000Z | 2022-03-04T23:10:02.000Z | mplscience/__init__.py | adamgayoso/mpscience | 0401ded920a4d09314e9a747cf4da07d17a60a05 | [
"MIT"
] | null | null | null | mplscience/__init__.py | adamgayoso/mpscience | 0401ded920a4d09314e9a747cf4da07d17a60a05 | [
"MIT"
] | null | null | null | """Matplotlib science style"""
from .core import available_styles, set_style, style_context
# https://github.com/python-poetry/poetry/pull/2366#issuecomment-652418094
# https://github.com/python-poetry/poetry/issues/144#issuecomment-623927302
try:
import importlib.metadata as importlib_metadata
except ModuleNotFo... | 31.625 | 75 | 0.804348 | """Matplotlib science style"""
from .core import available_styles, set_style, style_context
# https://github.com/python-poetry/poetry/pull/2366#issuecomment-652418094
# https://github.com/python-poetry/poetry/issues/144#issuecomment-623927302
try:
import importlib.metadata as importlib_metadata
except ModuleNotFo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3a06da5ff6c0053e4dc72e9a222d828921a7534c | 4,153 | py | Python | template/templates.py | dkratzert/FinalCif | 07ca23dbb4e7439b108a906521a118cdb876d97e | [
"Beerware"
] | 13 | 2020-01-14T16:23:48.000Z | 2022-02-16T18:02:08.000Z | template/templates.py | dkratzert/FinalCif | 07ca23dbb4e7439b108a906521a118cdb876d97e | [
"Beerware"
] | 24 | 2021-04-21T05:30:42.000Z | 2022-03-31T20:07:29.000Z | template/templates.py | dkratzert/FinalCif | 07ca23dbb4e7439b108a906521a118cdb876d97e | [
"Beerware"
] | 1 | 2021-08-09T16:48:33.000Z | 2021-08-09T16:48:33.000Z | from contextlib import suppress
with suppress(ImportError):
| 44.180851 | 120 | 0.666265 | from contextlib import suppress
from pathlib import Path
from typing import List
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QFileDialog, QListWidgetItem
with suppress(ImportError):
from appwindow import AppWindow
from tools.settings import FinalCifSettings
class Repor... | 0 | 0 | 0 | 3,822 | 0 | 0 | 0 | 87 | 182 |
1815a1cfdf441bab8f5c07943254b362f00a655f | 163 | py | Python | celery/settings.py | alculquicondor/AmigoCloud-IGP-Sync | 56de7e9137340054159289ef9c6534bb1b5872fc | [
"MIT"
] | null | null | null | celery/settings.py | alculquicondor/AmigoCloud-IGP-Sync | 56de7e9137340054159289ef9c6534bb1b5872fc | [
"MIT"
] | null | null | null | celery/settings.py | alculquicondor/AmigoCloud-IGP-Sync | 56de7e9137340054159289ef9c6534bb1b5872fc | [
"MIT"
] | null | null | null | from os import environ
TOKEN = environ.get('AMIGOCLOUD_TOKEN')
BROKER_URL = environ.get('BROKER_URL')
PROJECT_URL = 'users/475/projects/13608'
DATASET_ID = 79746
| 23.285714 | 40 | 0.779141 | from os import environ
TOKEN = environ.get('AMIGOCLOUD_TOKEN')
BROKER_URL = environ.get('BROKER_URL')
PROJECT_URL = 'users/475/projects/13608'
DATASET_ID = 79746
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
855c72651aff3902ac92bec1942941cff9cf4170 | 342 | py | Python | scripts/twist_remapper.py | tamago117/kcctsim | 0cd72c79ade6be48ad59fb9cfb202dcbe8de69cf | [
"Apache-2.0"
] | 1 | 2021-11-25T07:53:53.000Z | 2021-11-25T07:53:53.000Z | scripts/twist_remapper.py | tamago117/kcctsim | 0cd72c79ade6be48ad59fb9cfb202dcbe8de69cf | [
"Apache-2.0"
] | 1 | 2021-09-09T06:34:32.000Z | 2021-11-02T11:49:00.000Z | scripts/twist_remapper.py | tamago117/kcctsim | 0cd72c79ade6be48ad59fb9cfb202dcbe8de69cf | [
"Apache-2.0"
] | 2 | 2021-10-01T13:43:58.000Z | 2021-11-25T07:53:54.000Z | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
pub = rospy.Publisher("/diff_drive_controller/cmd_vel", Twist, queue_size = 10)
if __name__ == '__main__':
rospy.init_node('twist_remapper', anonymous=True)
rospy.Subscriber("/cmd_vel", Twist, callback)
rospy.spin() | 28.5 | 79 | 0.733918 | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
pub = rospy.Publisher("/diff_drive_controller/cmd_vel", Twist, queue_size = 10)
def callback(data):
pub.publish(data)
if __name__ == '__main__':
rospy.init_node('twist_remapper', anonymous=True)
rospy.Subscriber("/cmd_vel", Twist, call... | 0 | 0 | 0 | 0 | 0 | 20 | 0 | 0 | 22 |
860f3238dfabe5abdc4b560671b0f41979c23fa1 | 48,472 | py | Python | qiskit/visualization/matplotlib.py | quantumjim/qiskit-terra | 5292f487eaa980986a1e5affae8c4fc50c743e71 | [
"Apache-2.0"
] | 1 | 2019-12-09T08:25:14.000Z | 2019-12-09T08:25:14.000Z | qiskit/visualization/matplotlib.py | quantumjim/qiskit-terra | 5292f487eaa980986a1e5affae8c4fc50c743e71 | [
"Apache-2.0"
] | 1 | 2020-03-29T19:57:14.000Z | 2020-03-29T21:49:25.000Z | qiskit/visualization/matplotlib.py | quantumjim/qiskit-terra | 5292f487eaa980986a1e5affae8c4fc50c743e71 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 41.894555 | 100 | 0.444875 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 0 | 1,388 | 0 | 45,685 | 0 | 0 | 0 | 122 | 369 |
a7cf222e3f96762239244a7b076603c3ca2e33f3 | 946 | py | Python | sjpClass.py | alkamid/wiktionary | ce242da609a1001ae7462b07da2f6e83f1a7281b | [
"MIT"
] | 3 | 2015-01-06T22:00:22.000Z | 2016-08-14T08:07:32.000Z | sjpClass.py | alkamid/wiktionary | ce242da609a1001ae7462b07da2f6e83f1a7281b | [
"MIT"
] | 56 | 2015-07-12T10:21:38.000Z | 2020-02-23T18:51:01.000Z | sjpClass.py | alkamid/wiktionary | ce242da609a1001ae7462b07da2f6e83f1a7281b | [
"MIT"
] | 2 | 2015-01-06T21:25:06.000Z | 2018-01-17T12:03:17.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
| 27.823529 | 136 | 0.609937 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pywikibot
class kategoriaSlowa():
def __init__(self, name, counter, pages, tabelka, outputFile):
self.name = name
self.counter = counter
self.pages = 'Wikipedysta:AlkamidBot/sjp/' + pages
self.buffer = ''
self.tabelka = tabel... | 0 | 0 | 0 | 370 | 0 | 470 | 0 | -5 | 69 |
8b6ebb32e27f26c072b135c85ff8fb1b572ad23d | 2,446 | py | Python | tests/test_filters.py | mobius-medical/flask-genshi | 68cba6c9cb604272a25f5e4c74e5a127e3ac7854 | [
"BSD-3-Clause"
] | null | null | null | tests/test_filters.py | mobius-medical/flask-genshi | 68cba6c9cb604272a25f5e4c74e5a127e3ac7854 | [
"BSD-3-Clause"
] | null | null | null | tests/test_filters.py | mobius-medical/flask-genshi | 68cba6c9cb604272a25f5e4c74e5a127e3ac7854 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from inspect import cleandoc
from flask_genshi import render_template
def test_applies_method_filters(app):
"""Method filters are applied for generated and rendered templates"""
with app.test_request_context():
genshi = app.extensions["genshi"]
render... | 31.766234 | 102 | 0.629599 | from __future__ import unicode_literals
from inspect import cleandoc
from genshi.filters import Transformer
from flask_genshi import render_template
from flatland.out.genshi import setup as flatland_setup
from flatland import Form, String
class FlatlandForm(Form):
username = String
def test_applies_method_fi... | 0 | 192 | 0 | 27 | 0 | 89 | 0 | 63 | 183 |
978ff0be8e3774dfa21908c9b4b49bc92d1eeb4e | 3,159 | py | Python | forms/models.py | ditttu/gymkhana-Nominations | 2a0e993c1b8362c456a9369b0b549d1c809a21df | [
"MIT"
] | 3 | 2018-02-27T13:48:28.000Z | 2018-03-03T21:57:50.000Z | forms/models.py | ditttu/gymkhana-Nominations | 2a0e993c1b8362c456a9369b0b549d1c809a21df | [
"MIT"
] | 6 | 2020-02-12T00:07:46.000Z | 2022-03-11T23:25:59.000Z | forms/models.py | ditttu/gymkhana-Nominations | 2a0e993c1b8362c456a9369b0b549d1c809a21df | [
"MIT"
] | 1 | 2019-03-26T20:19:57.000Z | 2019-03-26T20:19:57.000Z | from django import forms
FIELD_TYPES = (
('Short_answer', forms.CharField),
('Paragraph', forms.CharField),
('Integer', forms.IntegerField),
('ChoiceField', forms.ChoiceField),
('MultipleChoiceField', forms.MultipleChoiceField),
# ('Date', forms.DateField),
)
QUES_TYPES = (
('Short_answe... | 28.981651 | 120 | 0.660336 | from django.db import models
from django import forms
from django.contrib.auth.models import User
from .form_dynamic import NominationForm
import json
class Questionnaire(models.Model):
name = models.CharField(max_length=100, null=True)
def __unicode__(self):
return self.name
def __str__(self):
... | 0 | 0 | 0 | 2,430 | 0 | 0 | 0 | 38 | 157 |
c910c09445a0e65ba2545dbe1c4a46731ae345b6 | 4,099 | py | Python | degmo/data/datasets.py | IcarusWizard/Deep-Generative-Models | 4117c11ad944bdeff106a80adbb3642a076af64e | [
"MIT"
] | 2 | 2019-11-21T15:50:59.000Z | 2019-12-17T02:44:19.000Z | degmo/data/datasets.py | IcarusWizard/Deep-Generative-Models | 4117c11ad944bdeff106a80adbb3642a076af64e | [
"MIT"
] | null | null | null | degmo/data/datasets.py | IcarusWizard/Deep-Generative-Models | 4117c11ad944bdeff106a80adbb3642a076af64e | [
"MIT"
] | 1 | 2021-07-02T05:49:29.000Z | 2021-07-02T05:49:29.000Z | import PIL.Image as Image
from functools import partial
DATADIR = 'dataset/'
load_celeba32 = partial(load_celeba, image_size=32)
load_celeba64 = partial(load_celeba, image_size=64)
load_celeba128 = partial(load_celeba, image_size=128) | 37.263636 | 112 | 0.68041 | import numpy as np
import torch, torchvision, math
from torch.functional import F
import os
import PIL.Image as Image
from functools import partial
DATADIR = 'dataset/'
class ImageDataset(torch.utils.data.Dataset):
def __init__(self, root, transform=None):
super().__init__()
self.root = root
... | 0 | 0 | 0 | 479 | 0 | 3,150 | 0 | 4 | 230 |
1a3578a56a4bccb214d3e2c35a83b6e6b51851e2 | 57,483 | py | Python | basistheory/api/tenants_api.py | Basis-Theory/basistheory-python | 5fd0f3d20fd07e8de45d6d5919e092c696049df1 | [
"Apache-2.0"
] | null | null | null | basistheory/api/tenants_api.py | Basis-Theory/basistheory-python | 5fd0f3d20fd07e8de45d6d5919e092c696049df1 | [
"Apache-2.0"
] | null | null | null | basistheory/api/tenants_api.py | Basis-Theory/basistheory-python | 5fd0f3d20fd07e8de45d6d5919e092c696049df1 | [
"Apache-2.0"
] | null | null | null | """
Basis Theory API
## Getting Started * Sign-in to [Basis Theory](https://basistheory.com) and go to [Applications](https://portal.basistheory.com/applications) * Create a Basis Theory Server to Server Application * All permissions should be selected * Paste the API Key into the `BT-API-KEY` variable # noqa... | 37.768068 | 300 | 0.517736 | """
Basis Theory API
## Getting Started * Sign-in to [Basis Theory](https://basistheory.com) and go to [Applications](https://portal.basistheory.com/applications) * Create a Basis Theory Server to Server Application * All permissions should be selected * Paste the API Key into the `BT-API-KEY` variable # noqa... | 0 | 0 | 0 | 55,908 | 0 | 0 | 0 | 786 | 361 |
2b5c325a1726de056d5d1198acc3940aef23c363 | 3,454 | py | Python | custom_components/nwsradar/config_flow.py | MatthewFlamm/ha_nws_radar | f039bf1abb94a48232599746f80d4c7e4af35de7 | [
"MIT"
] | 21 | 2019-07-18T23:38:22.000Z | 2021-01-08T01:14:44.000Z | custom_components/nwsradar/config_flow.py | MatthewFlamm/ha_nws_radar | f039bf1abb94a48232599746f80d4c7e4af35de7 | [
"MIT"
] | 7 | 2019-09-06T13:14:49.000Z | 2020-12-18T17:49:34.000Z | custom_components/nwsradar/config_flow.py | MatthewFlamm/ha_nws_radar | f039bf1abb94a48232599746f80d4c7e4af35de7 | [
"MIT"
] | 2 | 2019-07-26T21:23:59.000Z | 2020-01-14T23:03:12.000Z | """Config flow for National Weather Service (NWS) integration."""
import logging
# pylint: disable=unused-import
_LOGGER = logging.getLogger(__name__)
| 32.895238 | 87 | 0.621888 | """Config flow for National Weather Service (NWS) integration."""
import logging
import voluptuous as vol
from nws_radar.nws_radar_mosaic import REGIONS
from homeassistant import config_entries
from . import unique_id
# pylint: disable=unused-import
from .const import (
CONF_LOOP,
CONF_STATION,
CONF_STY... | 0 | 0 | 2,680 | 290 | 0 | 0 | 0 | 194 | 136 |
e288a19792ad0dab33c86bbab35d030926f6a073 | 2,944 | py | Python | xinci/model.py | Lapis-Hong/xinci | 9234ef6e426dfa282c334ff79f4f76b475eb10f3 | [
"MIT"
] | 23 | 2018-06-18T15:35:47.000Z | 2021-07-28T02:19:16.000Z | xinci/model.py | Lapis-Hong/xinci | 9234ef6e426dfa282c334ff79f4f76b475eb10f3 | [
"MIT"
] | null | null | null | xinci/model.py | Lapis-Hong/xinci | 9234ef6e426dfa282c334ff79f4f76b475eb10f3 | [
"MIT"
] | 10 | 2018-06-20T07:01:17.000Z | 2020-08-31T15:56:24.000Z | #!/usr/bin/env python
# coding: utf-8
# @Author: lapis-hong
# @Date : 2018/6/17
"""This module contains the main algorithm for chinese word extraction.
criterion 1:
solid rate
criterion 2:
character entropy
"""
from __future__ import unicode_literals
from __future__ import division
| 37.74359 | 108 | 0.66712 | #!/usr/bin/env python
# coding: utf-8
# @Author: lapis-hong
# @Date : 2018/6/17
"""This module contains the main algorithm for chinese word extraction.
criterion 1:
solid rate
criterion 2:
character entropy
"""
from __future__ import unicode_literals
from __future__ import division
import math
from indexer i... | 39 | 0 | 0 | 2,531 | 0 | 0 | 0 | 12 | 90 |
86c4428f80dd80644e84963f60d1a11c38e4a4c2 | 561 | py | Python | Machine_Learning/ZCSNumpy.py | ZuoCaiSong/Python | 137d1c4c79f9594b9bc2c7dc7728246e697f1329 | [
"MIT"
] | null | null | null | Machine_Learning/ZCSNumpy.py | ZuoCaiSong/Python | 137d1c4c79f9594b9bc2c7dc7728246e697f1329 | [
"MIT"
] | null | null | null | Machine_Learning/ZCSNumpy.py | ZuoCaiSong/Python | 137d1c4c79f9594b9bc2c7dc7728246e697f1329 | [
"MIT"
] | null | null | null | #! usr/bin/env python
# -*- coding:utf-8 -*-
"""
"""
'''
NumPy
()
'''
'''
NumPy(dimensions)(axes)(rank)
'''
#eg:
'''
3D [1,2,3]
13
'''
#ndarraylist
arr2 = [[1,0,0],
[0,1,0]]
'''
arr2 2 ()
'''
'''
NumPy ndarray
numpy.arraypythonarray.array
'''
# numpy
a = arange(15).reshape(3, 5)
print a
#
print "a", a.ndim
... | 13.357143 | 44 | 0.682709 | #! usr/bin/env python
# -*- coding:utf-8 -*-
"""
基础篇
"""
from numpy import *
'''
NumPy的主要对象是同种元素的多维数组。
这是一个所有的元素都是一种类型、通过一个正整数元组索引的元素表格(通常是元素是数字)
'''
'''
NumPy中维度(dimensions)叫做轴(axes),轴的个数叫做秩(rank)。
'''
#eg:
'''
在3D空间一个点的坐标 [1,2,3]
是一个秩为1的数组,它只有一个轴,轴的长度为3
'''
#注意直接写,他的类型不是一个ndarray,是一个list,此处只是用于举例说明秩
arr2 = [[1,0,... | 627 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 22 |
077630693a28af4ea5bf434f4de1bcb506757b3e | 1,696 | py | Python | tests/unit/test_fileclient.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2020-01-02T09:03:21.000Z | 2020-01-02T09:03:21.000Z | tests/unit/test_fileclient.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_fileclient.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2020-01-02T09:03:24.000Z | 2020-01-02T09:03:24.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: :email: `Bo Maryniuk <bo@suse.de>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
# Import Salt libs
| 32.615385 | 82 | 0.628538 | # -*- coding: utf-8 -*-
'''
:codeauthor: :email: `Bo Maryniuk <bo@suse.de>`
'''
# Import Python libs
from __future__ import absolute_import
import errno
# Import Salt Testing libs
from tests.support.mock import patch, Mock
from tests.support.unit import TestCase
# Import Salt libs
from salt.ext.six.moves import ... | 0 | 0 | 0 | 1,311 | 0 | 0 | 0 | 58 | 133 |
9e5a009aa9aeb584ea41f3acb660d59e05af5898 | 11,072 | py | Python | prepare_datasets.py | Jakob-Bach/Meta-Learning-Feature-Importance | 089e5c7a5be91307f747e00b38b1567386fbee16 | [
"MIT"
] | null | null | null | prepare_datasets.py | Jakob-Bach/Meta-Learning-Feature-Importance | 089e5c7a5be91307f747e00b38b1567386fbee16 | [
"MIT"
] | null | null | null | prepare_datasets.py | Jakob-Bach/Meta-Learning-Feature-Importance | 089e5c7a5be91307f747e00b38b1567386fbee16 | [
"MIT"
] | null | null | null | """Prepare datasets
Script that:
- downloads, pre-processes, and saves base datasets from OpenML
- computes meta-features
- computes meta-targets (combining feature-importance measures and base models)
- saves the meta-datasets
Usage: python -m prepare_datasets --help
"""
import argparse
import pathlib
# Download ... | 58.582011 | 110 | 0.694906 | """Prepare datasets
Script that:
- downloads, pre-processes, and saves base datasets from OpenML
- computes meta-features
- computes meta-targets (combining feature-importance measures and base models)
- saves the meta-datasets
Usage: python -m prepare_datasets --help
"""
import argparse
import multiprocessing
impor... | 0 | 0 | 0 | 0 | 0 | 7,730 | 0 | 15 | 376 |
3f79f678ffc367e4156a50c0372bba0efcd118d0 | 4,749 | py | Python | mywebsocket.py | malengelajosue/app_flask | ea656abb859d8941e9a4761736f2a6ce4b91f7aa | [
"MIT"
] | null | null | null | mywebsocket.py | malengelajosue/app_flask | ea656abb859d8941e9a4761736f2a6ce4b91f7aa | [
"MIT"
] | null | null | null | mywebsocket.py | malengelajosue/app_flask | ea656abb859d8941e9a4761736f2a6ce4b91f7aa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import signal
import tornado.ioloop
import tornado.web
import tornado.websocket
import tornado.wsgi as myapp_wsgi
# Javascript Usage:
# var ws = new WebSocket('ws://localhost:8000/ws');
# ws.onopen = function(event){ console.log('socket open'); }
# ws.onclose = function(event){ console.log('so... | 29.314815 | 169 | 0.620131 | #!/usr/bin/env python
import signal
import sys
import tornado.ioloop
import tornado.web
import tornado.websocket
import tornado.wsgi as myapp_wsgi
from datetime import datetime
import time
import ast
import random
from datetime import date
from models.model import Sites
from models.model import Coordonnates
from mode... | 0 | 0 | 0 | 3,391 | 0 | 94 | 0 | 58 | 271 |
ef071130d8e688b2bf7d1480cb9a43266fc55e27 | 4,576 | py | Python | compile.py | KValexander/compile-java-project | 62aab5ca9ec53705daa25a21875fc5c97e71db97 | [
"MIT"
] | null | null | null | compile.py | KValexander/compile-java-project | 62aab5ca9ec53705daa25a21875fc5c97e71db97 | [
"MIT"
] | null | null | null | compile.py | KValexander/compile-java-project | 62aab5ca9ec53705daa25a21875fc5c97e71db97 | [
"MIT"
] | null | null | null | import os
# Storage
concat = ""
assets = []
startclass = ""
# Static config
config = {
"javapath": "java",
"classpath": "class",
"sourcetxt": "source.txt",
"compilebat": "compile.bat",
"startclass": "Main.class",
"runbat": "run.bat",
"copyassets": "true"
}
# Getting configurations from a file
if os.path.exist... | 26 | 138 | 0.674825 | import shutil
import os
import re
from tkinter import *
# Storage
concat = ""
assets = []
startclass = ""
# Static config
config = {
"javapath": "java",
"classpath": "class",
"sourcetxt": "source.txt",
"compilebat": "compile.bat",
"startclass": "Main.class",
"runbat": "run.bat",
"copyassets": "true"
}
# Gett... | 0 | 0 | 0 | 0 | 0 | 3,423 | 0 | -20 | 243 |
6d79c61a4cd03cad002390bea3fef1d83f0bef83 | 601 | py | Python | multiprocessing_module/multiprocessing_test2.py | kenwaldek/python | e6aaf5616a456a4fb91889c0617bd6511f1a223e | [
"MIT"
] | 1 | 2019-02-24T09:57:16.000Z | 2019-02-24T09:57:16.000Z | multiprocessing_module/multiprocessing_test2.py | kenwaldek/python | e6aaf5616a456a4fb91889c0617bd6511f1a223e | [
"MIT"
] | null | null | null | multiprocessing_module/multiprocessing_test2.py | kenwaldek/python | e6aaf5616a456a4fb91889c0617bd6511f1a223e | [
"MIT"
] | 4 | 2017-05-21T15:34:53.000Z | 2018-09-25T06:56:15.000Z | #! /usr/bin/env python3
# -*- coding:utf-8 -*-
###############################################################
# kenwaldek MIT-license
#
# Title: multiprocessing 2 Version: 1.0
# Date: 30-12-16 Language: python3
# Description: multiprocessing dus me... | 25.041667 | 63 | 0.44426 | #! /usr/bin/env python3
# -*- coding:utf-8 -*-
###############################################################
# © kenwaldek MIT-license
#
# Title: multiprocessing 2 Version: 1.0
# Date: 30-12-16 Language: python3
# Description: multiprocessing dus m... | 2 | 0 | 0 | 0 | 0 | 11 | 0 | 0 | 23 |
d0f18eb34b3ac7f1fbda4ccdac297a8ef889417b | 1,088 | py | Python | leetcode-python/num002.py | shuaizi/leetcode | c943410575f380a00335bf5ac8d361af53a92d78 | [
"Apache-2.0"
] | null | null | null | leetcode-python/num002.py | shuaizi/leetcode | c943410575f380a00335bf5ac8d361af53a92d78 | [
"Apache-2.0"
] | null | null | null | leetcode-python/num002.py | shuaizi/leetcode | c943410575f380a00335bf5ac8d361af53a92d78 | [
"Apache-2.0"
] | null | null | null | __author__ = 'shuai'
l1 = ListNode(2)
l1.next = ListNode(4)
l1.next.next = ListNode(3)
l2 = ListNode(5)
l2.next = ListNode(6)
l2.next.next = ListNode(4)
sol = Solution()
sol.addTwoNumbers(l1, l2) | 23.148936 | 45 | 0.465074 | __author__ = 'shuai'
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
class Solution(object):
def addTwoNumbers(self, l1, l2):
"""
:type l1: ListNode
:type l2: ListNode
:rtype: ListNode
"""
ret = ListNode(0)
... | 0 | 0 | 0 | 844 | 0 | 0 | 0 | 0 | 46 |
9d16548fc6a8b1b86bb49107b9c13023f78ef594 | 3,051 | py | Python | publish/tests/models.py | nacady/django-publish | a9b0b0b0ce0a2cd664d256edc4c819180dc882df | [
"BSD-3-Clause"
] | null | null | null | publish/tests/models.py | nacady/django-publish | a9b0b0b0ce0a2cd664d256edc4c819180dc882df | [
"BSD-3-Clause"
] | null | null | null | publish/tests/models.py | nacady/django-publish | a9b0b0b0ce0a2cd664d256edc4c819180dc882df | [
"BSD-3-Clause"
] | 1 | 2021-06-28T03:59:45.000Z | 2021-06-28T03:59:45.000Z | from datetime import datetime
# publishable model with a reverse relation to
# page (as a child)
# non-publishable reverse relation to page (as a child)
update_pub_date.pub_date = datetime.now()
| 29.621359 | 74 | 0.715831 | from django.db import models
from datetime import datetime
from publish.models import Publishable
class Site(models.Model):
title = models.CharField(max_length=100)
domain = models.CharField(max_length=100)
class FlatPage(Publishable):
url = models.CharField(max_length=100, db_index=True)
title = mo... | 0 | 0 | 0 | 2,395 | 0 | 129 | 0 | 24 | 295 |
c4bcfd12173f327f06cebc80aa483d7df62edc93 | 3,151 | py | Python | tests/test_ddg_global_var_dependencies.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 6,132 | 2015-08-06T23:24:47.000Z | 2022-03-31T21:49:34.000Z | tests/test_ddg_global_var_dependencies.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 2,272 | 2015-08-10T08:40:07.000Z | 2022-03-31T23:46:44.000Z | tests/test_ddg_global_var_dependencies.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 1,155 | 2015-08-06T23:37:39.000Z | 2022-03-31T05:54:11.000Z | import os
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))
arches = {'x86_64'}
if __name__ == "__main__":
main()
| 43.164384 | 171 | 0.720406 | import os
import angr
import nose
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))
arches = {'x86_64'}
def main():
test_ddg_global_var_dependencies()
def test_ddg_global_var_dependencies():
for arch in arches:
run_ddg_global_var_dependencies(arch... | 0 | 0 | 0 | 0 | 0 | 2,812 | 0 | -20 | 182 |
83b0710d125addf1a454b4ea6976092a23001346 | 930 | py | Python | src/IO.py | Rahoo11/Jarvis | 6fac03e6f7bb963d0632ec781323210b3379603b | [
"MIT"
] | null | null | null | src/IO.py | Rahoo11/Jarvis | 6fac03e6f7bb963d0632ec781323210b3379603b | [
"MIT"
] | null | null | null | src/IO.py | Rahoo11/Jarvis | 6fac03e6f7bb963d0632ec781323210b3379603b | [
"MIT"
] | null | null | null | import logging
# LOGGING SETTINGS
# Save detailed information to log file
handler_file = logging.FileHandler("jarvis.log")
handler_file.setFormatter(logging.Formatter(
"%(asctime)s %(levelname)s %(filename)s:%(lineno)d - %(message)s",
"%Y-%m-%d %H:%M:%S"
))
# Output simple information to stderr
handler_stder... | 22.682927 | 76 | 0.691398 | from datetime import datetime
import logging
# LOGGING SETTINGS
# Save detailed information to log file
handler_file = logging.FileHandler("jarvis.log")
handler_file.setFormatter(logging.Formatter(
"%(asctime)s %(levelname)s %(filename)s:%(lineno)d - %(message)s",
"%Y-%m-%d %H:%M:%S"
))
# Output simple infor... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 22 |
6bf254e4d47110abc5fa56df01806709a669c1dd | 8,744 | py | Python | sfo.py | ayassinsayed/py.dataformat.sfo | 99b2ad11b162318f7e5251a760bd5b53e1cf826d | [
"MIT"
] | 1 | 2021-09-06T04:27:13.000Z | 2021-09-06T04:27:13.000Z | sfo.py | Jasily/py.dataformat.sfo | 99b2ad11b162318f7e5251a760bd5b53e1cf826d | [
"MIT"
] | null | null | null | sfo.py | Jasily/py.dataformat.sfo | 99b2ad11b162318f7e5251a760bd5b53e1cf826d | [
"MIT"
] | 4 | 2017-10-28T18:31:00.000Z | 2021-01-26T00:24:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 - cologler <skyoflw@gmail.com>
# ----------
#
# ----------
__all__ = [
'FormatError',
'SfoFile',
'PSVGameSfo',
'PSPGameSfo',
]
_BYTE_ORDER = 'little'
if __name__ == '__main__':
for i in range(0, 1):
... | 28.763158 | 98 | 0.589776 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 - cologler <skyoflw@gmail.com>
# ----------
#
# ----------
import io
__all__ = [
'FormatError',
'SfoFile',
'PSVGameSfo',
'PSPGameSfo',
]
class FormatError(Exception):
pass
_BYTE_ORDER = 'little'
class He... | 0 | 1,655 | 0 | 6,146 | 0 | 191 | 0 | -12 | 384 |
2f90e72ab2ad376594d32a0c909e3065372a297e | 1,066 | py | Python | motelsAPI/settings/dev.py | amartinez1/5letrasAPI | 670b638a8254a0809c9f953350cd1a3264b61bf7 | [
"MIT"
] | 2 | 2015-05-02T12:30:22.000Z | 2015-05-08T18:13:43.000Z | motelsAPI/settings/dev.py | amartinez1/5letrasAPI | 670b638a8254a0809c9f953350cd1a3264b61bf7 | [
"MIT"
] | null | null | null | motelsAPI/settings/dev.py | amartinez1/5letrasAPI | 670b638a8254a0809c9f953350cd1a3264b61bf7 | [
"MIT"
] | null | null | null |
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'motels_db',
}
}
ALLOWED_HOSTS = []
CORS_ORIGIN_ALLOW_ALL = True
DEBUG = True
SECRET_KEY = 'test'
INSTALLED_APPS += (
'autofixture',
'debug_toolbar',
'django_extensions',
... | 23.688889 | 80 | 0.661351 | from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'motels_db',
}
}
ALLOWED_HOSTS = []
CORS_ORIGIN_ALLOW_ALL = True
DEBUG = True
SECRET_KEY = 'test'
INSTALLED_APPS += (
'autofixture',
'debug_toolbar',
'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 23 |
a1adb53a7219e0575c94c4f8e32bc32af0a24a42 | 955 | py | Python | snooper.py | boztalay/SuperconCubeCmd | 9cbd685a75dbf9fdf7a04e7a240b07117b1fbe82 | [
"MIT"
] | null | null | null | snooper.py | boztalay/SuperconCubeCmd | 9cbd685a75dbf9fdf7a04e7a240b07117b1fbe82 | [
"MIT"
] | null | null | null | snooper.py | boztalay/SuperconCubeCmd | 9cbd685a75dbf9fdf7a04e7a240b07117b1fbe82 | [
"MIT"
] | null | null | null | import sys
import cubey
if __name__ == "__main__":
if len(sys.argv) != 2:
print "Gimme a serial port!"
sys.exit(1)
serialPort = sys.argv[1]
main(serialPort)
| 23.292683 | 93 | 0.536126 | import sys
import cubey
def main(serialPort):
cube = cubey.Cube(serialPort)
print "Listening, Ctrl-C to stop..."
try:
while True:
rawMessage = cube.sendCommand("m n u")
printMessage(rawMessage)
except KeyboardInterrupt:
print
cube.breakOut()
print "D... | 0 | 0 | 0 | 0 | 0 | 721 | 0 | 0 | 46 |
9e5764903cdf85638ab62747d681b0695238c4e3 | 1,411 | py | Python | day-9&10/main.py | a18antsv/Python-Two-Week-Challenge | cfdefe5e2643d1c1ee66d08a16a7ffc175ba1a3a | [
"MIT"
] | null | null | null | day-9&10/main.py | a18antsv/Python-Two-Week-Challenge | cfdefe5e2643d1c1ee66d08a16a7ffc175ba1a3a | [
"MIT"
] | null | null | null | day-9&10/main.py | a18antsv/Python-Two-Week-Challenge | cfdefe5e2643d1c1ee66d08a16a7ffc175ba1a3a | [
"MIT"
] | null | null | null | from flask import Flask
base_url = "http://hn.algolia.com/api/v1"
# This URL gets the newest stories.
new = f"{base_url}/search_by_date?tags=story"
# This URL gets the most popular stories
popular = f"{base_url}/search?tags=story"
# This function makes the URL to get the detail of a storie by id.
# Heres the docum... | 24.754386 | 70 | 0.690291 | import requests
from flask import Flask, render_template, request, redirect
base_url = "http://hn.algolia.com/api/v1"
# This URL gets the newest stories.
new = f"{base_url}/search_by_date?tags=story"
# This URL gets the most popular stories
popular = f"{base_url}/search?tags=story"
# This function makes the URL to... | 0 | 841 | 0 | 0 | 0 | 37 | 0 | 30 | 90 |
d32135b6fdf1615d5e0b4352267bf443c9e38704 | 2,651 | py | Python | feewaiver/urls.py | dbca-wa/feewaiver | 7938a0e9d18924c12b27c0a411b6d7eccb40166b | [
"Apache-2.0"
] | null | null | null | feewaiver/urls.py | dbca-wa/feewaiver | 7938a0e9d18924c12b27c0a411b6d7eccb40166b | [
"Apache-2.0"
] | 12 | 2021-02-24T02:33:01.000Z | 2022-01-25T02:37:39.000Z | feewaiver/urls.py | mintcoding/feewaiver | 47d69db91386f760dd36d87cbb565a9bb72a27d5 | [
"Apache-2.0"
] | 1 | 2021-01-08T02:15:27.000Z | 2021-01-08T02:15:27.000Z | from django.conf import settings
from django.contrib import admin
from django.conf.urls import url, include
from django.conf.urls.static import static
from rest_framework import routers
#from feewaiver import views, users_api, api
from feewaiver import views, api
from ledger.urls import urlpatterns as ledger_patterns
... | 48.2 | 130 | 0.744247 | from django.conf import settings
from django.contrib import admin
from django.conf.urls import url, include
from django.conf.urls.static import static
from rest_framework import routers
#from feewaiver import views, users_api, api
from feewaiver import views, api
from ledger.urls import urlpatterns as ledger_patterns
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 29 | 22 |
54f82229c0438a79d9123d69c7d0467d0c47c179 | 1,758 | py | Python | ros/src/twist_controller/twist_controller.py | Acharya-Kiran/CarND-Capstone | bc5f59ea20271e2e46e156fff86cd2482b52c5f2 | [
"MIT"
] | null | null | null | ros/src/twist_controller/twist_controller.py | Acharya-Kiran/CarND-Capstone | bc5f59ea20271e2e46e156fff86cd2482b52c5f2 | [
"MIT"
] | null | null | null | ros/src/twist_controller/twist_controller.py | Acharya-Kiran/CarND-Capstone | bc5f59ea20271e2e46e156fff86cd2482b52c5f2 | [
"MIT"
] | null | null | null |
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
| 27.904762 | 101 | 0.755973 | from pid import PID
from lowpass import LowPassFilter
from yaw_controller import YawController
import rospy
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self,vehicle_mass,fuel_capacity,brake_deadband,decel_limit,
accel_limit,wheel_radius,wheel_base,steer_ratio,max_lat_accel,max_st... | 0 | 0 | 0 | 1,587 | 0 | 0 | 0 | 20 | 111 |
9ecb3b223a203a77d74b6711d0796c6b4e890962 | 27,213 | py | Python | others/Pytorch/utilis_rnn.py | jhuebotter/CartpoleSNNdemo | d18a85cbc45bff48295c46c9cd8c9fc00192318c | [
"MIT"
] | null | null | null | others/Pytorch/utilis_rnn.py | jhuebotter/CartpoleSNNdemo | d18a85cbc45bff48295c46c9cd8c9fc00192318c | [
"MIT"
] | null | null | null | others/Pytorch/utilis_rnn.py | jhuebotter/CartpoleSNNdemo | d18a85cbc45bff48295c46c9cd8c9fc00192318c | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from datetime import datetime
import collections
import os
import copy
from SI_Toolkit.load_and_normalize import load_normalization_info, load_data, normalize_df, denormalize_df
def get_device():
"""
Small function to correctly send data to GPU or CPU depending what is av... | 38.545326 | 132 | 0.614449 | import torch
import torch.nn as nn
from torch.utils import data
from datetime import datetime
import collections
import os
import random as rnd
import copy
from Modeling.Pytorch.utilis_rnn_specific import *
from SI_Toolkit.load_and_normalize import load_normalization_info, load_data, normalize_df, denormalize_df
... | 0 | 0 | 0 | 9,472 | 0 | 5,711 | 0 | 35 | 225 |
a14001fe338c11a2de9e1cb5a8130727cb1dcd35 | 7,654 | py | Python | resto_client/cli/parser/parser_configure_server.py | CNES/resto_client | 7048bd79c739e33882ebd664790dcf0528e81aa4 | [
"Apache-2.0"
] | 6 | 2019-12-20T09:12:30.000Z | 2021-07-08T11:44:55.000Z | resto_client/cli/parser/parser_configure_server.py | CNES/resto_client | 7048bd79c739e33882ebd664790dcf0528e81aa4 | [
"Apache-2.0"
] | null | null | null | resto_client/cli/parser/parser_configure_server.py | CNES/resto_client | 7048bd79c739e33882ebd664790dcf0528e81aa4 | [
"Apache-2.0"
] | 1 | 2019-12-17T20:16:39.000Z | 2019-12-17T20:16:39.000Z | # -*- coding: utf-8 -*-
"""
.. admonition:: License
Copyright 2019 CNES
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 requir... | 44.5 | 100 | 0.74902 | # -*- coding: utf-8 -*-
"""
.. admonition:: License
Copyright 2019 CNES
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 requir... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 30 | 0 |
4498832be13a9415d6ca76fd5ad2398b9e886b1d | 1,059 | py | Python | src/push_button.py | albang/arisa | 9b7ea5e7befc92d1febb038476d03e858a622153 | [
"MIT"
] | null | null | null | src/push_button.py | albang/arisa | 9b7ea5e7befc92d1febb038476d03e858a622153 | [
"MIT"
] | null | null | null | src/push_button.py | albang/arisa | 9b7ea5e7befc92d1febb038476d03e858a622153 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
import os, time
os.system('mpg123 -g100 /home/pi/paw_patrol_courte.mp3 &')
GPIO.setwarnings(False) # Ignore warning for now
GPIO.setmode(GPIO.BOARD) # Use physical pin numbering
GPIO.setup(10, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) # Set... | 40.730769 | 128 | 0.756374 | #!/usr/bin/env python3
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
import os, time
def button_callback(channel):
print("Button was pushed!")
os.system('mpg123 /home/pi/minute_courte.mp3 &')
def button_callback2(channel):
print("Button was pushed!")
os.system('mpg123 -g100 /home/pi/paw_... | 0 | 0 | 0 | 0 | 0 | 198 | 0 | 0 | 46 |
4da98b7e4cedd701321a8df23f73f41ffd79cf6e | 1,054 | py | Python | src/utils.py | michaellas/streaming-vid-to-gifs | ee5df22c820d4d631f0437c98a53989ecb76dca3 | [
"MIT"
] | null | null | null | src/utils.py | michaellas/streaming-vid-to-gifs | ee5df22c820d4d631f0437c98a53989ecb76dca3 | [
"MIT"
] | 1 | 2015-04-07T12:24:26.000Z | 2015-04-07T12:28:30.000Z | src/utils.py | michaellas/streaming-vid-to-gifs | ee5df22c820d4d631f0437c98a53989ecb76dca3 | [
"MIT"
] | null | null | null | import time
import sys
if __name__ == '__main__':
'''
@log_called_times_decorator
def ff():
print 'f'
while True:
ff()
time.sleep(1)
'''
print_progress(45)
print ''
print_progress(x=20,max=200) | 26.35 | 107 | 0.578748 | import time
import sys
def log_called_times_decorator(func):
def wrapper(*args):
wrapper.count += 1
# print "The function I modify has been called {0} times(s).".format(wrapper.count)
now = time.time()
if now - wrapper.last_log > wrapper.dt:
print '[DEBUG] In last %ds %s... | 0 | 0 | 0 | 0 | 0 | 748 | 0 | 0 | 46 |
4495fdf8627af041231ecfd1e216c9c24557ea8c | 847 | py | Python | monte_carlo.py | yandexdataschool/pyretina | 300d3cd460ded071d75d3729e9b5dc1489d86d73 | [
"Apache-2.0"
] | 2 | 2016-05-28T15:59:47.000Z | 2018-07-30T21:05:18.000Z | monte_carlo.py | yandexdataschool/pyretina | 300d3cd460ded071d75d3729e9b5dc1489d86d73 | [
"Apache-2.0"
] | null | null | null | monte_carlo.py | yandexdataschool/pyretina | 300d3cd460ded071d75d3729e9b5dc1489d86d73 | [
"Apache-2.0"
] | null | null | null |
number_of_events = 10
if __name__ == "__main__":
main("config/mc.json") | 21.175 | 82 | 0.641086 | from pyretina.mc import monte_carlo
import numpy as np
import json
import os
import os.path as osp
import shutil
number_of_events = 10
def main(conf):
with open(conf, 'r') as f:
config = json.load(f)
for N in np.arange(20, 520, 20):
config['scattering']['number_of_particles'] = {
'type' : 'randin... | 0 | 0 | 0 | 0 | 0 | 634 | 0 | -19 | 157 |
18ed809f9eec9232085b1804143efe6ca93e3a6e | 5,950 | py | Python | miner.py | OwlEyes33/crypto-alpha | dc3b39ecf38f3f445ecd94057775220b651633fc | [
"Apache-2.0"
] | null | null | null | miner.py | OwlEyes33/crypto-alpha | dc3b39ecf38f3f445ecd94057775220b651633fc | [
"Apache-2.0"
] | null | null | null | miner.py | OwlEyes33/crypto-alpha | dc3b39ecf38f3f445ecd94057775220b651633fc | [
"Apache-2.0"
] | null | null | null | import logging
logging.basicConfig(level=logging.DEBUG)
if __name__ == "__main__":
miner = Miner()
miner.routine()
| 37.421384 | 86 | 0.557479 | import logging
import os
import time
from math import inf
from os import environ
from threading import Thread
import requests
from redis import Redis
from block import Block
from blockchain import Blockchain
from peer2peer import PeerToPeerMessage
from transaction import Transaction
logging.basicConfig(level=logging... | 0 | 745 | 0 | 4,784 | 0 | 0 | 0 | 27 | 267 |
1486c16002e2c1f7f36eced992718519ad8c6db1 | 959 | py | Python | web2py-appliances-master/MyForum/models/db.py | wantsomechocolate/WantsomeBeanstalk | 8c8a0a80490d04ea52661a3114fd3db8de65a01e | [
"BSD-3-Clause"
] | null | null | null | web2py-appliances-master/MyForum/models/db.py | wantsomechocolate/WantsomeBeanstalk | 8c8a0a80490d04ea52661a3114fd3db8de65a01e | [
"BSD-3-Clause"
] | null | null | null | web2py-appliances-master/MyForum/models/db.py | wantsomechocolate/WantsomeBeanstalk | 8c8a0a80490d04ea52661a3114fd3db8de65a01e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
DEBUG = True
db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])
response.generic_patterns = ['*'] if request.is_local else []
from gluon.tools import Auth, Service
auth = Auth(db)
auth.define_tables(username=False, signature=False)
service = Service()
## configure email
m... | 33.068966 | 78 | 0.777894 | # -*- coding: utf-8 -*-
DEBUG = True
db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])
response.generic_patterns = ['*'] if request.is_local else []
from gluon.tools import Auth, Service, prettydate
auth = Auth(db)
auth.define_tables(username=False, signature=False)
service = Service()
## confi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 0 |
9ded2fcc8e677e149baf4d0a230b66939619b9e9 | 8,353 | py | Python | conceptnet5/vectors/retrofit.py | MattCurryCom/conceptnet5 | a16d94e635aee3d35a22aa04fcad7bb87ce927d8 | [
"Apache-2.0"
] | 1 | 2018-11-27T17:00:57.000Z | 2018-11-27T17:00:57.000Z | conceptnet5/vectors/retrofit.py | MattCurryCom/conceptnet5 | a16d94e635aee3d35a22aa04fcad7bb87ce927d8 | [
"Apache-2.0"
] | null | null | null | conceptnet5/vectors/retrofit.py | MattCurryCom/conceptnet5 | a16d94e635aee3d35a22aa04fcad7bb87ce927d8 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
def retrofit(row_labels, dense_frame, sparse_csr,
iterations=5, verbosity=0, max_cleanup_iters=20,
orig_vec_weight=0.15):
"""
Retrofitting is a process of combining information from a machine-learned
space of term vectors with further stru... | 48.005747 | 130 | 0.704058 | import pandas as pd
import numpy as np
from sklearn.preprocessing import normalize
from .sparse_matrix_builder import build_from_conceptnet_table
from .formats import load_hdf, save_hdf
def sharded_retrofit(dense_hdf_filename, conceptnet_filename, output_filename,
iterations=5, nshards=6, verbosi... | 0 | 0 | 0 | 0 | 0 | 2,009 | 0 | 81 | 112 |
fcd076838a13b16b0181931dfa476968f0b03f64 | 11,297 | py | Python | Stock_Analysis/auto_value_stock.py | parmarsuraj99/Finance | d9f012e33a99b959fdde575feedeb5922b379fe2 | [
"MIT"
] | 1 | 2022-02-25T01:25:21.000Z | 2022-02-25T01:25:21.000Z | Stock_Analysis/auto_value_stock.py | StockScripts/Finance | 330bb46ea8e4c7ad5f3150cfa6d25e356178b189 | [
"MIT"
] | null | null | null | Stock_Analysis/auto_value_stock.py | StockScripts/Finance | 330bb46ea8e4c7ad5f3150cfa6d25e356178b189 | [
"MIT"
] | 2 | 2021-01-28T21:52:30.000Z | 2021-02-16T13:26:35.000Z | # Code from https://medium.com/datadriveninvestor/use-python-to-value-a-stock-automatically-3b520422ab6 by Bohmian
# Importing required modules
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import numpy as np
import time
from config import financial_model_prep
pd.set_option('display.max_column... | 46.681818 | 284 | 0.615208 | # Code from https://medium.com/datadriveninvestor/use-python-to-value-a-stock-automatically-3b520422ab6 by Bohmian
# Importing required modules
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import numpy as np
import time
from config import financial_model_prep
pd.set_option('display.max_column... | 0 | 0 | 0 | 0 | 0 | 4,418 | 0 | 11 | 253 |
901b7a71198943a53f223f18bbc124edf656a124 | 2,580 | py | Python | src/100_simple_aggregation.py | j20232/kaggle_earthquake | 47fac5f2e8d2ad4fab82426a0b6af18b71e4b57b | [
"MIT"
] | null | null | null | src/100_simple_aggregation.py | j20232/kaggle_earthquake | 47fac5f2e8d2ad4fab82426a0b6af18b71e4b57b | [
"MIT"
] | null | null | null | src/100_simple_aggregation.py | j20232/kaggle_earthquake | 47fac5f2e8d2ad4fab82426a0b6af18b71e4b57b | [
"MIT"
] | null | null | null | """Extract simple aggregation features
Reference: https://www.kaggle.com/gpreda/lanl-earthquake-eda-and-prediction
"""
import sys
import competition as cc
TRAIN_CSV_DIRECTORY_PATH = cc.INPUT_PATH / sys.argv[1]
TRAIN_CSV_LIST = list(TRAIN_CSV_DIRECTORY_PATH.glob('**/*.csv'))
if __name__ == "__main__":
trai... | 38.507463 | 91 | 0.622481 | """Extract simple aggregation features
Reference: https://www.kaggle.com/gpreda/lanl-earthquake-eda-and-prediction
"""
import sys
import numpy as np
import pandas as pd
from pathlib import Path
from tqdm import tqdm
import competition as cc
from common import stop_watch
TRAIN_CSV_DIRECTORY_PATH = cc.INPUT_PATH /... | 0 | 1,807 | 0 | 0 | 0 | 0 | 0 | 6 | 133 |
0b3eba4af37debbbb40bec37c6e9b379c1156729 | 8,817 | py | Python | segment.py | neelsj/syndata-generation | df73cc9a146c34870c3d80acce0ca04b314ec1b0 | [
"MIT"
] | null | null | null | segment.py | neelsj/syndata-generation | df73cc9a146c34870c3d80acce0ca04b314ec1b0 | [
"MIT"
] | null | null | null | segment.py | neelsj/syndata-generation | df73cc9a146c34870c3d80acce0ca04b314ec1b0 | [
"MIT"
] | null | null | null | from datetime import datetime
import torch
#model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resnet50', pretrained=True)
model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resnet101', pretrained=True)
# model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_mobilenet_v3_large', pretrained=Tru... | 31.830325 | 132 | 0.565612 |
import os
from datetime import datetime
import json
import matplotlib.pyplot as plt
from tqdm import tqdm
import torch
import numpy as np
from skimage import measure
from shapely.geometry import Polygon, MultiPolygon
from PIL import Image
import cv2
#model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resn... | 0 | 0 | 0 | 0 | 0 | 7,808 | 0 | 22 | 293 |
1abc147f5b65fc34db7ff312e43a5af4e6f6fb0a | 21,660 | py | Python | analysis/graveyard/study_definition.py | opensafely/antibody-and-antiviral-deployment | 27cd171870fdd161468d1cabd1eaee76f1943593 | [
"MIT"
] | null | null | null | analysis/graveyard/study_definition.py | opensafely/antibody-and-antiviral-deployment | 27cd171870fdd161468d1cabd1eaee76f1943593 | [
"MIT"
] | 1 | 2022-03-18T16:20:19.000Z | 2022-03-18T16:20:19.000Z | analysis/graveyard/study_definition.py | opensafely/antibody-and-antiviral-deployment | 27cd171870fdd161468d1cabd1eaee76f1943593 | [
"MIT"
] | null | null | null | ################################################################################
#
# Description: This script provides the formal specification of the study data
# that will be extracted from the OpenSAFELY database.
#
# Output: output/data/input_*.csv.gz
#
# Author(s): M Green (edited by H Curtis)
# Date... | 31.255411 | 128 | 0.673084 | ################################################################################
#
# Description: This script provides the formal specification of the study data
# that will be extracted from the OpenSAFELY database.
#
# Output: output/data/input_*.csv.gz
#
# Author(s): M Green (edited by H Curtis)
# Date... | 15 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 22 |
9c633934769dee6380c21948f3259c49e26608fa | 5,146 | py | Python | records_mover/db/bigquery/unloader.py | cwegrzyn/records-mover | e3b71d6c09d99d0bcd6a956b9d09d20f8abe98d2 | [
"Apache-2.0"
] | 36 | 2020-03-17T11:56:51.000Z | 2022-01-19T16:03:32.000Z | records_mover/db/bigquery/unloader.py | cwegrzyn/records-mover | e3b71d6c09d99d0bcd6a956b9d09d20f8abe98d2 | [
"Apache-2.0"
] | 60 | 2020-03-02T23:13:29.000Z | 2021-05-19T15:05:42.000Z | records_mover/db/bigquery/unloader.py | cwegrzyn/records-mover | e3b71d6c09d99d0bcd6a956b9d09d20f8abe98d2 | [
"Apache-2.0"
] | 4 | 2020-08-11T13:17:37.000Z | 2021-11-05T21:11:52.000Z | import logging
logger = logging.getLogger(__name__)
| 45.539823 | 115 | 0.666148 | import sqlalchemy
from contextlib import contextmanager
from typing import List, Iterator, Optional, Union, Tuple
import logging
from google.cloud.bigquery.dbapi.connection import Connection
from google.cloud.bigquery.client import Client
from google.cloud.bigquery.job import ExtractJobConfig
from records_mover.db.unlo... | 0 | 432 | 0 | 3,922 | 0 | 0 | 0 | 429 | 309 |
82eca7e21b92148d602ade08730e4aef0f573478 | 1,219 | py | Python | depth_completion/config/resnet18_Baseline_config.py | tsunghan-mama/Depth-Completion | d73328d1d704470a6fd3859e2e1810bc311b1dc3 | [
"MIT"
] | 67 | 2020-07-11T09:44:10.000Z | 2022-03-30T07:38:46.000Z | depth_completion/config/resnet18_Baseline_config.py | tsunghan-mama/Depth-Completion | d73328d1d704470a6fd3859e2e1810bc311b1dc3 | [
"MIT"
] | 8 | 2020-07-14T05:50:03.000Z | 2022-01-19T09:07:46.000Z | depth_completion/config/resnet18_Baseline_config.py | patrickwu2/Depth-Completion | e9c52e2cb2dce558d6787e246bbc51c1670c16ca | [
"MIT"
] | 9 | 2019-10-12T01:09:51.000Z | 2020-05-26T21:35:28.000Z |
common_config = {
}
train_config = {
"dataset_name": "matterport",
"model_name": "ResNet18SkipConnection",
"in_channel": 9,
"device_ids": [0],
"seed": 7122,
"num_workers": 8,
"mode": "train",
"train_path": "/tmp2/tsunghan/new_matterport/v1",
"lr": 1e-4,
"batch_size": 8,
... | 27.088889 | 133 | 0.61854 |
common_config = {
}
train_config = {
"dataset_name": "matterport",
"model_name": "ResNet18SkipConnection",
"in_channel": 9,
"device_ids": [0],
"seed": 7122,
"num_workers": 8,
"mode": "train",
"train_path": "/tmp2/tsunghan/new_matterport/v1",
"lr": 1e-4,
"batch_size": 8,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
38b4f6b2219146f62a43cb5525a1f50ceb4102df | 660 | py | Python | scheduler_task/study_apscheduler/examples/demo.py | 2581676612/python | b309564a05838b23044bb8112fd4ef71307266b6 | [
"MIT"
] | 112 | 2017-09-19T17:38:38.000Z | 2020-05-27T18:00:27.000Z | scheduler_task/study_apscheduler/examples/demo.py | tomoncle/Python-notes | ce675486290c3d1c7c2e4890b57e3d0c8a1228cc | [
"MIT"
] | null | null | null | scheduler_task/study_apscheduler/examples/demo.py | tomoncle/Python-notes | ce675486290c3d1c7c2e4890b57e3d0c8a1228cc | [
"MIT"
] | 56 | 2017-09-20T01:24:12.000Z | 2020-04-16T06:19:31.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 17-8-13 11:33
# @Author : Tom.Lee
# @CopyRight : 2016-2017 OpenBridge by yihecloud
# @File : demo.py
# @Product : PyCharm
# @Docs :
# @Source :
import os
from apscheduler.schedulers.blocking import Blo... | 26.4 | 85 | 0.587879 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 17-8-13 上午11:33
# @Author : Tom.Lee
# @CopyRight : 2016-2017 OpenBridge by yihecloud
# @File : demo.py
# @Product : PyCharm
# @Docs :
# @Source :
import os
from apscheduler.schedulers.blocking import B... | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0fc246feb45369af60c1a8007ad889850bd24825 | 4,829 | py | Python | clearblade/ClearBladeCore.py | sraman0302/ClearBlade-Python-SDK | bde192ef86969c8d1c592f7697ca104bc2362408 | [
"Apache-2.0"
] | 2 | 2018-05-10T18:38:04.000Z | 2020-12-19T08:14:21.000Z | clearblade/ClearBladeCore.py | sraman0302/ClearBlade-Python-SDK | bde192ef86969c8d1c592f7697ca104bc2362408 | [
"Apache-2.0"
] | 6 | 2018-01-13T17:05:51.000Z | 2021-09-01T18:25:41.000Z | clearblade/ClearBladeCore.py | sraman0302/ClearBlade-Python-SDK | bde192ef86969c8d1c592f7697ca104bc2362408 | [
"Apache-2.0"
] | 4 | 2018-11-08T21:18:08.000Z | 2021-05-10T01:07:14.000Z | from __future__ import absolute_import
| 31.154839 | 168 | 0.600745 | from __future__ import absolute_import
import atexit
from . import Users
from . import Devices
from . import Collections
from . import Messaging
from . import Code
from .Developers import * # allows you to import Developer from ClearBladeCore
from . import cbLogs
class System:
def __exitcode(self):
# for... | 0 | 0 | 0 | 4,516 | 0 | 0 | 0 | -4 | 276 |
78df92a0ac52515a71841949cff2f4cccb3a01f0 | 698 | py | Python | GoogleCodeJam2017/Round0/TidyNumbers/TidyNumbers.py | Jspsun/CompetitiveCoding | a815bbcdab1fb30bd83730a7abd3505bff8bfb78 | [
"MIT"
] | null | null | null | GoogleCodeJam2017/Round0/TidyNumbers/TidyNumbers.py | Jspsun/CompetitiveCoding | a815bbcdab1fb30bd83730a7abd3505bff8bfb78 | [
"MIT"
] | null | null | null | GoogleCodeJam2017/Round0/TidyNumbers/TidyNumbers.py | Jspsun/CompetitiveCoding | a815bbcdab1fb30bd83730a7abd3505bff8bfb78 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
__main__()
| 21.151515 | 71 | 0.465616 | def __main__():
f = open("in.txt", 'r')
o = open("out.txt", 'w')
noOfCases = int(f.readline())
for testNo in range(noOfCases):
counter = 0
data = f.readline()
output = solver(data[:-1])
output = int(output)
o.write("Case #" + str(testNo + 1) + ": " + str(output) ... | 0 | 0 | 0 | 0 | 0 | 585 | 0 | 0 | 68 |
9d9072a0352d441e7a4e2e3e0c976746c5e8f9af | 986 | py | Python | project_dashboard/projects/crud.py | KruizerChick/project-dashboard | aa1d3fa713e49049ac7184dbe44a1f915ff56906 | [
"MIT"
] | null | null | null | project_dashboard/projects/crud.py | KruizerChick/project-dashboard | aa1d3fa713e49049ac7184dbe44a1f915ff56906 | [
"MIT"
] | null | null | null | project_dashboard/projects/crud.py | KruizerChick/project-dashboard | aa1d3fa713e49049ac7184dbe44a1f915ff56906 | [
"MIT"
] | null | null | null | """ CRUD class for Projects app """
| 29 | 62 | 0.703854 | """ CRUD class for Projects app """
from crudbuilder.abstract import BaseCrudBuilder
from .models.project import Project
from .models.stakeholder import Stakeholder
class ProjectCrud(BaseCrudBuilder):
""" CRUD class for Project model """
model = Project
search_fields = ["id", "name", "description"]
t... | 0 | 0 | 0 | 771 | 0 | 0 | 0 | 63 | 113 |
db476ed9048fe8a87e8164fd5dd10cfe61c7b0bf | 486 | py | Python | L1Trigger/L1TMuonOverlap/python/fakeOmtfFwVersion_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 2 | 2020-10-26T18:40:32.000Z | 2021-04-10T16:33:25.000Z | L1Trigger/L1TMuonOverlap/python/fakeOmtfFwVersion_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 30 | 2015-11-04T11:42:27.000Z | 2021-12-01T07:56:34.000Z | L1Trigger/L1TMuonOverlap/python/fakeOmtfFwVersion_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 8 | 2016-03-25T07:17:43.000Z | 2021-07-08T17:11:21.000Z | import FWCore.ParameterSet.Config as cms
omtfFwVersionSource = cms.ESSource(
"EmptyESSource",
recordName = cms.string('L1TMuonOverlapFwVersionRcd'),
iovIsRunNotTime = cms.bool(True),
firstValid = cms.vuint32(1)
)
###OMTF FW ESProducer.
omtfFwVersion = cms.ESProducer(
"L1TMuonOverlapFwVersionESProd... | 25.578947 | 58 | 0.716049 | import FWCore.ParameterSet.Config as cms
omtfFwVersionSource = cms.ESSource(
"EmptyESSource",
recordName = cms.string('L1TMuonOverlapFwVersionRcd'),
iovIsRunNotTime = cms.bool(True),
firstValid = cms.vuint32(1)
)
###OMTF FW ESProducer.
omtfFwVersion = cms.ESProducer(
"L1TMuonOverlapFwVersionESProd... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bccbd46e4500f876a02aadf6e0c1065d389cdf38 | 4,603 | py | Python | planning/planning/page/check_in_out/check_in_out.py | nishta/planning | 5be1574111b9b94ec75c74960ace4314985b0014 | [
"MIT"
] | null | null | null | planning/planning/page/check_in_out/check_in_out.py | nishta/planning | 5be1574111b9b94ec75c74960ace4314985b0014 | [
"MIT"
] | null | null | null | planning/planning/page/check_in_out/check_in_out.py | nishta/planning | 5be1574111b9b94ec75c74960ace4314985b0014 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
| 39.681034 | 291 | 0.74169 | from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, validate_email_add, today
import datetime
from planning.planning.myfunction import mail_format_pms,actual_date_update,close_task_update
@frappe.whitelist()
def checking_checkout(task=None,check_status=None,name=None):
cur_date_tim... | 0 | 4,303 | 0 | 0 | 0 | 0 | 0 | 96 | 158 |
b88cc6b6407fec4332c3df0cdd6f4c0dc8c904b3 | 4,290 | py | Python | packages/girder/plugins/oauth/girder_oauth/providers/google.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | 1 | 2019-11-14T18:13:26.000Z | 2019-11-14T18:13:26.000Z | packages/girder/plugins/oauth/girder_oauth/providers/google.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | 3 | 2018-11-15T19:52:40.000Z | 2022-02-14T21:56:22.000Z | packages/girder/plugins/oauth/girder_oauth/providers/google.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | 3 | 2018-05-21T19:45:19.000Z | 2019-04-08T19:53:07.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | 35.75 | 79 | 0.571329 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | 0 | 601 | 0 | 2,666 | 0 | 0 | 0 | 74 | 135 |
f00f0283a00861b00d8ace96a341aa1af6392dc8 | 177 | py | Python | todoapp/todos/urls.py | dhavall13/REST-API-TodoCRUD | 5d7179d12c4436e38658d9a7483497c8db99f4be | [
"MIT"
] | null | null | null | todoapp/todos/urls.py | dhavall13/REST-API-TodoCRUD | 5d7179d12c4436e38658d9a7483497c8db99f4be | [
"MIT"
] | null | null | null | todoapp/todos/urls.py | dhavall13/REST-API-TodoCRUD | 5d7179d12c4436e38658d9a7483497c8db99f4be | [
"MIT"
] | null | null | null | from rest_framework import routers
from .api import TodoViewSet
router = routers.DefaultRouter()
router.register('api/todos', TodoViewSet, 'todos')
urlpatterns = router.urls
| 19.666667 | 50 | 0.79096 | from rest_framework import routers
from .api import TodoViewSet
router = routers.DefaultRouter()
router.register('api/todos', TodoViewSet, 'todos')
urlpatterns = router.urls
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8e57bc0091c782bab46c7958d378a4ddf117035a | 378 | py | Python | test.py | xiaoweiChen/OpenVINO_Model_Convert_Website | ce8b0d225d1e0228aace772e3017ad3154543688 | [
"Apache-2.0"
] | 1 | 2019-11-12T07:11:39.000Z | 2019-11-12T07:11:39.000Z | test.py | xiaoweiChen/OpenVINO_Model_Convert_Website | ce8b0d225d1e0228aace772e3017ad3154543688 | [
"Apache-2.0"
] | null | null | null | test.py | xiaoweiChen/OpenVINO_Model_Convert_Website | ce8b0d225d1e0228aace772e3017ad3154543688 | [
"Apache-2.0"
] | null | null | null |
import sys
from converter import processPreTrainModels
if __name__ == '__main__':
if len(sys.argv) < 4:
print("usage: {} proto caffemodel output_dir".format(sys.argv[0]))
exit(0)
proto = sys.argv[1]
model = sys.argv[2]
output = sys.argv[3]
file_path = processPreTrainModels(
proto,
... | 19.894737 | 70 | 0.648148 |
import sys
from converter import processPreTrainModels
if __name__ == '__main__':
if len(sys.argv) < 4:
print("usage: {} proto caffemodel output_dir".format(sys.argv[0]))
exit(0)
proto = sys.argv[1]
model = sys.argv[2]
output = sys.argv[3]
file_path = processPreTrainModels(
proto,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e837781e421b78fc059079fdefb0bdc32efc4414 | 3,229 | py | Python | scripts/eval.py | zsinsense/demosaicnet | bbe8151cab86dbe46b76806cf9ec353994b389ff | [
"MIT"
] | null | null | null | scripts/eval.py | zsinsense/demosaicnet | bbe8151cab86dbe46b76806cf9ec353994b389ff | [
"MIT"
] | null | null | null | scripts/eval.py | zsinsense/demosaicnet | bbe8151cab86dbe46b76806cf9ec353994b389ff | [
"MIT"
] | null | null | null | #!/bin/env python
"""Evaluate a demosaicking model."""
import argparse
import torch as th
from torch.utils.data import DataLoader
import ttools
from ttools.modules.image_operators import crop_like
import demosaicnet
LOG = ttools.get_logger(__name__)
def main(args):
"""Entrypoint to the training."""
# Load... | 29.354545 | 87 | 0.569836 | #!/bin/env python
"""Evaluate a demosaicking model."""
import argparse
import os
import time
import torch as th
from torch.utils.data import DataLoader
import numpy as np
import ttools
from ttools.modules.image_operators import crop_like
import demosaicnet
LOG = ttools.get_logger(__name__)
class PSNR(th.nn.Module)... | 0 | 0 | 0 | 205 | 0 | 0 | 0 | -25 | 89 |
ace7c9af9eb249c27faf798e56fca31751c8a6ad | 1,030 | py | Python | lrp_toolbox/training_test.py | KushDen/deepimportance_code_release | 5d16f1f95568dc402be6dfed4ad993ec0dbaa356 | [
"MIT"
] | 18 | 2020-07-11T01:58:02.000Z | 2021-09-17T07:08:34.000Z | lrp_toolbox/training_test.py | KushDen/deepimportance_code_release | 5d16f1f95568dc402be6dfed4ad993ec0dbaa356 | [
"MIT"
] | 13 | 2021-01-13T14:41:26.000Z | 2021-12-29T02:15:10.000Z | lrp_toolbox/training_test.py | KushDen/deepimportance_code_release | 5d16f1f95568dc402be6dfed4ad993ec0dbaa356 | [
"MIT"
] | 8 | 2020-02-19T21:30:30.000Z | 2022-03-11T01:34:33.000Z | '''
@author: Sebastian Lapuschkin
@maintainer: Sebastian Lapuschkin
@contact: sebastian.lapuschkin@hhi.fraunhofer.de, wojciech.samek@hhi.fraunhofer.de
@date: 30.09.2015
@version: 1.0
@copyright: Copyright (c) 2015-2017, Sebastian Lapuschkin, Alexander Binder, Gregoire Montavon, Klaus-Robert Mueller, Wojciech Samek
@li... | 28.611111 | 216 | 0.703883 | '''
@author: Sebastian Lapuschkin
@maintainer: Sebastian Lapuschkin
@contact: sebastian.lapuschkin@hhi.fraunhofer.de, wojciech.samek@hhi.fraunhofer.de
@date: 30.09.2015
@version: 1.0
@copyright: Copyright (c) 2015-2017, Sebastian Lapuschkin, Alexander Binder, Gregoire Montavon, Klaus-Robert Mueller, Wojciech Samek
@li... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c16cdfe67a57a720e41f4d1f6a82111d663200a5 | 149 | py | Python | tests/iac_integration/cdk/testdata/cdk_v2/python/app.py | zhuhaow/aws-sam-cli | 59d82ec6848b5a0cdd544d8ada838d4d34052971 | [
"Apache-2.0"
] | 2,959 | 2018-05-08T21:48:56.000Z | 2020-08-24T14:35:39.000Z | tests/iac_integration/cdk/testdata/cdk_v2/python/app.py | zhuhaow/aws-sam-cli | 59d82ec6848b5a0cdd544d8ada838d4d34052971 | [
"Apache-2.0"
] | 1,469 | 2018-05-08T22:44:28.000Z | 2020-08-24T20:19:24.000Z | tests/iac_integration/cdk/testdata/cdk_v2/python/app.py | zhuhaow/aws-sam-cli | 59d82ec6848b5a0cdd544d8ada838d4d34052971 | [
"Apache-2.0"
] | 642 | 2018-05-08T22:09:19.000Z | 2020-08-17T09:04:37.000Z | #!/usr/bin/env python3
from aws_cdk import App
from python.python_stack import PythonStack
app = App()
PythonStack(app, "TestStack")
app.synth()
| 13.545455 | 43 | 0.751678 | #!/usr/bin/env python3
from aws_cdk import App
from python.python_stack import PythonStack
app = App()
PythonStack(app, "TestStack")
app.synth()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9eeb1c341a09b93233cbe624f89cddfd33fcd2f2 | 940 | py | Python | part4c.py | ddlatumalea/signal_analysis | 9e62e553f56e4c60c7e0963187e01c262d8d820e | [
"MIT"
] | null | null | null | part4c.py | ddlatumalea/signal_analysis | 9e62e553f56e4c60c7e0963187e01c262d8d820e | [
"MIT"
] | null | null | null | part4c.py | ddlatumalea/signal_analysis | 9e62e553f56e4c60c7e0963187e01c262d8d820e | [
"MIT"
] | 1 | 2022-03-03T13:31:23.000Z | 2022-03-03T13:31:23.000Z | def fourier_transform(yi):
"""a, b = fourier_transform(yi).
Real-valued Fourier transform that determines the
coefficients of the Fourier series for a given
signal y. The coefficients of the cosine terms are
returned in the array a; those of the sine terms
in the array b. Frequencies start at ze... | 39.166667 | 62 | 0.601064 | def fourier_transform(yi):
"""a, b = fourier_transform(yi).
Real-valued Fourier transform that determines the
coefficients of the Fourier series for a given
signal y. The coefficients of the cosine terms are
returned in the array a; those of the sine terms
in the array b. Frequencies start at ze... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
686add8ace25e333d96d69d7abbb938d46abc531 | 1,453 | py | Python | distance-betweeen-obj/main.py | CrispenGari/opencv-python | cfa862fbf3b8b2c8899b76cee2774d6fb72ba00e | [
"MIT"
] | 1 | 2021-11-08T07:37:05.000Z | 2021-11-08T07:37:05.000Z | distance-betweeen-obj/main.py | CrispenGari/opencv-python | cfa862fbf3b8b2c8899b76cee2774d6fb72ba00e | [
"MIT"
] | null | null | null | distance-betweeen-obj/main.py | CrispenGari/opencv-python | cfa862fbf3b8b2c8899b76cee2774d6fb72ba00e | [
"MIT"
] | null | null | null | import cv2
import numpy as np
points = []
letters = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
image = np.zeros((512, 512, 3), np.uint8)
while True:
cv2.putText(image, f'TO CLEAR THE POINTS PRESS (c)', (20, 20), cv2.FONT_HERSHEY_PLAIN, 1, (255, 255, 255), 1)
cv2.imshow("DISTANCE BETWEEN TWO POINTS", image)
cv2.se... | 37.25641 | 126 | 0.604267 | import cv2
import numpy as np
from math import pow, sqrt
points = []
letters = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
image = np.zeros((512, 512, 3), np.uint8)
def mouseEvent(event, x, y, params, flags):
if event == cv2.EVENT_LBUTTONDOWN:
cv2.circle(image, (x, y), 5, (0, 0, 255), -1)
cv2.putText(image,... | 0 | 0 | 0 | 0 | 0 | 772 | 0 | 5 | 67 |
8e8c991f6293082c8cec862c8abc181e7ff19a46 | 1,948 | py | Python | Learning/python_data_analysis8.py | VictoriaGuXY/MCO-Menu-Checker-Online | 706e2e1bf7395cc344f382ea2ac53d964d459f86 | [
"MIT"
] | null | null | null | Learning/python_data_analysis8.py | VictoriaGuXY/MCO-Menu-Checker-Online | 706e2e1bf7395cc344f382ea2ac53d964d459f86 | [
"MIT"
] | null | null | null | Learning/python_data_analysis8.py | VictoriaGuXY/MCO-Menu-Checker-Online | 706e2e1bf7395cc344f382ea2ac53d964d459f86 | [
"MIT"
] | null | null | null | import pandas as pd
"""
output
"""
# Note: some output is shortened to save spaces.
# This file introduces methods to group data.
# Data from https://github.com/mwaskom/seaborn-data
df = pd.read_csv('E:\\tips.csv')
"""
total_bill tip sex smoker day time size
0 16.99 1.01 Female No S... | 32.466667 | 80 | 0.479466 | import json
import pandas as pd
import numpy as np
from pandas import DataFrame
"""
output
"""
# Note: some output is shortened to save spaces.
# This file introduces methods to group data.
# Data from https://github.com/mwaskom/seaborn-data
df = pd.read_csv('E:\\tips.csv')
"""
total_bill tip sex smoker ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -6 | 66 |
948080e247360f7be9e2aa7cdc3fd4bb0c67bdac | 438 | py | Python | functions/reportIssue.py | chiluf/visvis.dev | 373846ea25044b7ca50f44c63dab4248e14deacd | [
"BSD-3-Clause"
] | null | null | null | functions/reportIssue.py | chiluf/visvis.dev | 373846ea25044b7ca50f44c63dab4248e14deacd | [
"BSD-3-Clause"
] | null | null | null | functions/reportIssue.py | chiluf/visvis.dev | 373846ea25044b7ca50f44c63dab4248e14deacd | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
def reportIssue():
""" help()
Open a webbrowser with the visvis website at the issue list.
"""
import webbro... | 23.052632 | 66 | 0.639269 | # -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
def reportIssue():
""" help()
Open a webbrowser with the visvis website at the issue list.
"""
import webbro... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
405b1e05e30665caf1b56d799edb993551a9f5b1 | 217 | py | Python | thirdfile.py | 1frenchfrog1/testgithub | 7191e44d75ba50438d9c2fe8f0fcf9fcf3a2a991 | [
"MIT"
] | null | null | null | thirdfile.py | 1frenchfrog1/testgithub | 7191e44d75ba50438d9c2fe8f0fcf9fcf3a2a991 | [
"MIT"
] | null | null | null | thirdfile.py | 1frenchfrog1/testgithub | 7191e44d75ba50438d9c2fe8f0fcf9fcf3a2a991 | [
"MIT"
] | null | null | null | #!/usr/bin/python
def printme3( str ):
"This prints a passed string into this function"
print(str)
return
def printme3too( str ):
"This prints a passed string into this function"
print(str)
return
| 18.083333 | 51 | 0.686636 | #!/usr/bin/python
def printme3( str ):
"This prints a passed string into this function"
print(str)
return
def printme3too( str ):
"This prints a passed string into this function"
print(str)
return
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
52c36ddcbbbc1ea0125baf76215d709418864b64 | 642 | py | Python | lec7.py | uni-student234/ISAT252 | 4c0942919c432456fe26900c23f076161b4cc266 | [
"MIT"
] | null | null | null | lec7.py | uni-student234/ISAT252 | 4c0942919c432456fe26900c23f076161b4cc266 | [
"MIT"
] | null | null | null | lec7.py | uni-student234/ISAT252 | 4c0942919c432456fe26900c23f076161b4cc266 | [
"MIT"
] | null | null | null | """
Week 2, day 7, lec 7
"""
# i = 5
# while i >= 0:
# i = i - 1
# if i == 3:
# # break #breaks the smallest loop
# # continue #skips the current iteration and moves on
# # pass #does nothing, but is placehold if you need something for syntax
# print(i)
# for ... | 20.0625 | 90 | 0.489097 | """
Week 2, day 7, lec 7
"""
# i = 5
# while i >= 0:
# i = i - 1
# if i == 3:
# # break #breaks the smallest loop
# # continue #skips the current iteration and moves on
# # pass #does nothing, but is placehold if you need something for syntax
# print(i)
# for ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6446ebc359e3c3467ceb30fabeaa007c3100a7f7 | 11,447 | py | Python | scripts/survivor_analysis/utils/annotate.py | a-paxton/oss-community-health | 93ff4d266b5390b53d8ed59f71616de68bcfdda7 | [
"MIT"
] | null | null | null | scripts/survivor_analysis/utils/annotate.py | a-paxton/oss-community-health | 93ff4d266b5390b53d8ed59f71616de68bcfdda7 | [
"MIT"
] | 1 | 2022-03-22T19:32:27.000Z | 2022-03-23T12:43:08.000Z | scripts/survivor_analysis/utils/annotate.py | a-paxton/oss-community-health | 93ff4d266b5390b53d8ed59f71616de68bcfdda7 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from collections import Counter
from datetime import datetime
from nltk.tokenize import RegexpTokenizer
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
import re
def annotate_logs(comments, tickets):
"""
Annotates comments and tickets with additional... | 34.478916 | 101 | 0.638857 | import pandas as pd
import numpy as np
from collections import Counter
from datetime import datetime
from nltk.tokenize import RegexpTokenizer
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
import re
def annotate_logs(comments, tickets):
"""
Annotates comments and tickets with additional... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
46a90fe428c07ac7366934d1e4ee7724a8b4f434 | 352 | py | Python | packages/Python/lldbsuite/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py | nathawes/swift-lldb | 3cbf7470e0f9191ec1fc1c69ce8048c1dc64ec77 | [
"Apache-2.0"
] | 427 | 2018-05-29T14:21:02.000Z | 2022-03-16T03:17:54.000Z | packages/Python/lldbsuite/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py | DalavanCloud/lldb | e913eaf2468290fb94c767d474d611b41a84dd69 | [
"Apache-2.0"
] | 25 | 2018-07-23T08:34:15.000Z | 2021-11-05T07:13:36.000Z | packages/Python/lldbsuite/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py | DalavanCloud/lldb | e913eaf2468290fb94c767d474d611b41a84dd69 | [
"Apache-2.0"
] | 52 | 2018-07-19T19:57:32.000Z | 2022-03-11T16:05:38.000Z | from lldbsuite.test import decorators
from lldbsuite.test import lldbinline
lldbinline.MakeInlineTest(
__file__, globals(), [
decorators.skipIfFreeBSD, decorators.skipIfLinux,
decorators.skipIfWindows,
decorators.expectedFailureAll(
oslist=['macosx'], archs=['i386'],
... | 32 | 57 | 0.6875 | from lldbsuite.test import decorators
from lldbsuite.test import lldbinline
lldbinline.MakeInlineTest(
__file__, globals(), [
decorators.skipIfFreeBSD, decorators.skipIfLinux,
decorators.skipIfWindows,
decorators.expectedFailureAll(
oslist=['macosx'], archs=['i386'],
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
af4dceb229fa3c43802c126ad350cbf15950b67e | 1,585 | bzl | Python | js/extensions.bzl | stoiky/rules_js | e61b61b98c2f5c733bf804f78db9f55b1fb2d599 | [
"Apache-2.0"
] | null | null | null | js/extensions.bzl | stoiky/rules_js | e61b61b98c2f5c733bf804f78db9f55b1fb2d599 | [
"Apache-2.0"
] | null | null | null | js/extensions.bzl | stoiky/rules_js | e61b61b98c2f5c733bf804f78db9f55b1fb2d599 | [
"Apache-2.0"
] | null | null | null | """Adapt repository rules in npm_import.bzl to be called from MODULE.bazel
See https://bazel.build/docs/bzlmod#extension-definition
"""
load("//js/private:pnpm_utils.bzl", "pnpm_utils")
load("//js/private:translate_pnpm_lock.bzl", translate_pnpm_lock_lib = "translate_pnpm_lock")
load("//js:npm_import.bzl", "npm_import... | 42.837838 | 113 | 0.637855 | """Adapt repository rules in npm_import.bzl to be called from MODULE.bazel
See https://bazel.build/docs/bzlmod#extension-definition
"""
load("//js/private:pnpm_utils.bzl", "pnpm_utils")
load("//js/private:translate_pnpm_lock.bzl", translate_pnpm_lock_lib = "translate_pnpm_lock")
load("//js:npm_import.bzl", "npm_import... | 0 | 0 | 0 | 0 | 0 | 787 | 0 | 0 | 23 |
c7b09eb689ac8f721c4645e55ec33f8b5d1f82bf | 32,780 | py | Python | paasta_tools/tron_tools.py | zhaoyanh1202/paasta | b0c148786f44476fe351fe410f0b81f0c941f3b6 | [
"Apache-2.0"
] | null | null | null | paasta_tools/tron_tools.py | zhaoyanh1202/paasta | b0c148786f44476fe351fe410f0b81f0c941f3b6 | [
"Apache-2.0"
] | null | null | null | paasta_tools/tron_tools.py | zhaoyanh1202/paasta | b0c148786f44476fe351fe410f0b81f0c941f3b6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015-2018 Yelp Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 35.864333 | 125 | 0.652013 | # Copyright 2015-2018 Yelp Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 0 | 259 | 0 | 17,423 | 0 | 4,488 | 0 | 775 | 1,122 |
6f6564a4b79638714786a730792e5cd34d3f9e05 | 1,755 | py | Python | invenio_records_presentation/workflows/presentation.py | CESNET/invenio-records-presentation | 547a2652a97feb1c6cd50e1ea917c2b5decb9286 | [
"MIT"
] | null | null | null | invenio_records_presentation/workflows/presentation.py | CESNET/invenio-records-presentation | 547a2652a97feb1c6cd50e1ea917c2b5decb9286 | [
"MIT"
] | 4 | 2019-03-19T16:18:22.000Z | 2021-06-28T12:33:14.000Z | invenio_records_presentation/workflows/presentation.py | CESNET/invenio-records-presentation | 547a2652a97feb1c6cd50e1ea917c2b5decb9286 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 CESNET.
#
# Invenio Records Presentation is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
""" Example Presentation workflow."""
from invenio_records_presentation.workflows import presentati... | 27 | 89 | 0.688889 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 CESNET.
#
# Invenio Records Presentation is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
""" Example Presentation workflow."""
from invenio_workflows import WorkflowEngine
from invenio_re... | 0 | 0 | 0 | 0 | 0 | 1,008 | 0 | 69 | 160 |
af18231ed684c46a269b36519eb707e9ab6b7d6a | 34,191 | py | Python | twit_analytics.py | nikb999/Twitter-analytics | 35074503be495e62fad282b9c723756df87119a7 | [
"MIT"
] | null | null | null | twit_analytics.py | nikb999/Twitter-analytics | 35074503be495e62fad282b9c723756df87119a7 | [
"MIT"
] | null | null | null | twit_analytics.py | nikb999/Twitter-analytics | 35074503be495e62fad282b9c723756df87119a7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#add the path of the twitter egg
import sys
egg_path = '/home/users/web/........./cgi-bin/PyPkg/twitter-1.14.3-py2.7.egg'
sys.path.append(egg_path)
# Import the CGI, string, sys, and md5crypt modules
import json, urllib2, re, time, datetime, sys, cgi, os
import sq... | 40.800716 | 197 | 0.534176 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#add the path of the twitter egg
import sys
egg_path = '/home/users/web/........./cgi-bin/PyPkg/twitter-1.14.3-py2.7.egg'
sys.path.append(egg_path)
# Import the CGI, string, sys, and md5crypt modules
import json, urllib2, re, time, datetime, sys, cgi, os
import sq... | 0 | 0 | 0 | 0 | 0 | 29,208 | 0 | 11 | 682 |
47aeba5f5a974bde56729cafe676435b3057e324 | 3,765 | py | Python | sonde/qaqc_viewer.py | wilsaj/pint | a2b2a6ea9ff480a168358af642cf36c7f3c5d0e4 | [
"BSD-3-Clause"
] | 1 | 2017-12-06T04:28:59.000Z | 2017-12-06T04:28:59.000Z | sonde/qaqc_viewer.py | wilsaj/pint | a2b2a6ea9ff480a168358af642cf36c7f3c5d0e4 | [
"BSD-3-Clause"
] | null | null | null | sonde/qaqc_viewer.py | wilsaj/pint | a2b2a6ea9ff480a168358af642cf36c7f3c5d0e4 | [
"BSD-3-Clause"
] | null | null | null | """
QAQC Viewer based on Chaco & Traits
"""
#from enthought.chaco.example_support import COLOR_PALETTE
#from enthought.enable.example_support import DemoFrame, demo_main
# Enthought library imports
# Chaco imports
#==============================================================================
# Attributes to use f... | 41.833333 | 110 | 0.601594 | """
QAQC Viewer based on Chaco & Traits
"""
#from enthought.chaco.example_support import COLOR_PALETTE
#from enthought.enable.example_support import DemoFrame, demo_main
# Enthought library imports
from enthought.enable.api import Window, Component, ComponentEditor
from enthought.traits.api import HasTraits, Instance... | 0 | 0 | 0 | 2,650 | 0 | 0 | 0 | 401 | 244 |
120fa0d15479ccd5b4653c3adf9354e51e55b55c | 573 | py | Python | ComicPub/comics/admin.py | Xonshiz/ComicPub | d332ee1b62d6c28347954280696c86898de6d125 | [
"MIT"
] | 8 | 2017-09-02T07:04:59.000Z | 2020-12-17T17:30:34.000Z | ComicPub/comics/admin.py | Xonshiz/ComicPub | d332ee1b62d6c28347954280696c86898de6d125 | [
"MIT"
] | 1 | 2017-10-24T12:49:57.000Z | 2017-10-24T15:04:44.000Z | ComicPub/comics/admin.py | Xonshiz/ComicPub | d332ee1b62d6c28347954280696c86898de6d125 | [
"MIT"
] | 4 | 2017-10-24T14:13:13.000Z | 2021-12-15T17:09:23.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from comics.models import Comic, ComicChapter
# class PageFileInline(admin.TabularInline):
# model = ComicChapter
#
#
# class PageAdmin(admin.ModelAdmin):
# inlines = [PageFileInline, ]
# class ChapterInline(adm... | 21.222222 | 47 | 0.724258 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from comics.models import Comic, ComicChapter
# class PageFileInline(admin.TabularInline):
# model = ComicChapter
#
#
# class PageAdmin(admin.ModelAdmin):
# inlines = [PageFileInline, ]
# class ChapterInline(adm... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d7e5e4980b5718dcaa9192759e6b4c3e5d658b97 | 2,457 | py | Python | chpt6/Generate_random_characters.py | GDG-Buea/learn-python | 9dfe8caa4b57489cf4249bf7e64856062a0b93c2 | [
"Apache-2.0"
] | null | null | null | chpt6/Generate_random_characters.py | GDG-Buea/learn-python | 9dfe8caa4b57489cf4249bf7e64856062a0b93c2 | [
"Apache-2.0"
] | 2 | 2018-05-21T09:39:00.000Z | 2018-05-27T15:59:15.000Z | chpt6/Generate_random_characters.py | GDG-Buea/learn-python | 9dfe8caa4b57489cf4249bf7e64856062a0b93c2 | [
"Apache-2.0"
] | 2 | 2018-05-19T14:59:56.000Z | 2018-05-19T15:25:48.000Z | # This program displays 100 lowercase letters, fifteen per line
main()
print()
# Draw a line from (x1, y1) to (x2, y2)
# def drawLine(x1, y1, x2, y2):
# turtle.penup()
# turtle.goto(x1, y1)
# turtle.pendown()
# turtle.goto(x2, y2)
# def writeText(s, x, y):
# turtle.penup() # Pull the pen up
# turtle.goto(x, y... | 23.179245 | 66 | 0.659341 | # This program displays 100 lowercase letters, fifteen per line
import turtle
from random import randint
def get_random_lower_case_letter():
return get_random_character('a', 'z')
def get_random_character(ch1, ch2):
return chr(randint(ord(ch1), ord(ch2)))
def write_text(s, x, y):
turtle.penup()
... | 0 | 0 | 0 | 0 | 0 | 533 | 0 | -3 | 137 |
b4b58aa4d7d83f1298f775781fc1a78f79bf902f | 531 | py | Python | miniProject/miniApp/urls.py | cs-fullstack-2019-spring/django-mini-project5-gkg901 | 35af15000480a104f46adb62ba9ceebd4d0ad7a1 | [
"Apache-2.0"
] | null | null | null | miniProject/miniApp/urls.py | cs-fullstack-2019-spring/django-mini-project5-gkg901 | 35af15000480a104f46adb62ba9ceebd4d0ad7a1 | [
"Apache-2.0"
] | null | null | null | miniProject/miniApp/urls.py | cs-fullstack-2019-spring/django-mini-project5-gkg901 | 35af15000480a104f46adb62ba9ceebd4d0ad7a1 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('allrecipes/', views.allrecipes, name='allrecipes'),
path('newrecipe/', views.newrecipe, name='newrecipe'),
path('profile/', views.profile, name='profile'),
path('newuser/', views.newuser, na... | 37.928571 | 69 | 0.664783 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('allrecipes/', views.allrecipes, name='allrecipes'),
path('newrecipe/', views.newrecipe, name='newrecipe'),
path('profile/', views.profile, name='profile'),
path('newuser/', views.newuser, na... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e63a707a6d1aecf82dd0e657d12e6dcba8e4283c | 3,996 | py | Python | hash_code.py | Arpan-206/EncryptoCLI | 26a7718ef387d46bfcf2d167e17a494de0165858 | [
"MIT"
] | 2 | 2021-10-20T13:38:45.000Z | 2022-01-11T12:36:49.000Z | hash_code.py | Arpan-206/EncryptoCLI | 26a7718ef387d46bfcf2d167e17a494de0165858 | [
"MIT"
] | null | null | null | hash_code.py | Arpan-206/EncryptoCLI | 26a7718ef387d46bfcf2d167e17a494de0165858 | [
"MIT"
] | null | null | null | # Importing the hashing library
# Importing the visual libraries
# Defining the hash function.
| 27.75 | 129 | 0.508008 | # Importing the hashing library
import hashlib
# Importing the visual libraries
from PyInquirer import Separator, prompt
from termcolor import colored
# Defining the hash function.
def hash_func():
# Asking the user for further data regarding algoritms
hash_info = prompt([
{
'type': 'lis... | 0 | 0 | 0 | 0 | 0 | 3,741 | 0 | 20 | 135 |
e155cdbdf8a6a6a7a4d4cc1a43c09c3a16b32d5c | 3,800 | py | Python | examples/plugins/single_project/sample_project/data/plugin/ui_service.py | janvonrickenbach/Envisage_wxPhoenix_py3 | cf79e5b2a0c3b46898a60b5fe5a2fb580604808b | [
"BSD-3-Clause"
] | null | null | null | examples/plugins/single_project/sample_project/data/plugin/ui_service.py | janvonrickenbach/Envisage_wxPhoenix_py3 | cf79e5b2a0c3b46898a60b5fe5a2fb580604808b | [
"BSD-3-Clause"
] | 1 | 2017-05-22T21:15:22.000Z | 2017-05-22T21:15:22.000Z | examples/plugins/single_project/sample_project/data/plugin/ui_service.py | janvonrickenbach/Envisage_wxPhoenix_py3 | cf79e5b2a0c3b46898a60b5fe5a2fb580604808b | [
"BSD-3-Clause"
] | 1 | 2019-10-01T07:03:58.000Z | 2019-10-01T07:03:58.000Z | #-----------------------------------------------------------------------------
#
# Copyright (c) 2007 by Enthought, Inc.
# All rights reserved.
#
#-----------------------------------------------------------------------------
"""
The UI service for the Data plugin.
"""
# Standard library imports.
import logging
# E... | 29.007634 | 78 | 0.460789 | #-----------------------------------------------------------------------------
#
# Copyright (c) 2007 by Enthought, Inc.
# All rights reserved.
#
#-----------------------------------------------------------------------------
"""
The UI service for the Data plugin.
"""
# Standard library imports.
import logging
# E... | 0 | 0 | 0 | 3,086 | 0 | 0 | 0 | 83 | 89 |
20dc02eb654f867beadeef8c295396bcf7913d05 | 8,460 | py | Python | metecho/tests/consumers.py | almostolmos/Metecho | 7f58eca163faafea1ce07ffb6f4de2449fa0b8df | [
"BSD-3-Clause"
] | 21 | 2020-04-02T21:39:58.000Z | 2022-01-31T19:43:47.000Z | metecho/tests/consumers.py | almostolmos/Metecho | 7f58eca163faafea1ce07ffb6f4de2449fa0b8df | [
"BSD-3-Clause"
] | 1,613 | 2020-03-26T16:39:57.000Z | 2022-03-07T14:54:16.000Z | metecho/tests/consumers.py | almostolmos/Metecho | 7f58eca163faafea1ce07ffb6f4de2449fa0b8df | [
"BSD-3-Clause"
] | 21 | 2020-07-21T11:58:47.000Z | 2021-11-25T00:48:21.000Z | import pytest
pytestmark = pytest.mark.asyncio
# These tests need to go last, after any tests that start up a Communicator:
| 33.307087 | 88 | 0.711348 | import pytest
from channels.db import database_sync_to_async
from channels.testing import WebsocketCommunicator
from ..api.model_mixins import Request
from ..api.push import push_message_about_instance, report_error
from ..api.serializers import (
EpicSerializer,
ProjectSerializer,
ScratchOrgSerializer,
... | 0 | 7,687 | 0 | 0 | 0 | 0 | 0 | 253 | 384 |
f3976e2ec215dc1bd2bd45dd144b13e71688e6f1 | 6,227 | py | Python | cajitos_site/users/routes.py | OlgaKuratkina/cajitos | 0bc13f71281a1a67c8bcd1a3ae343ad0b14d9bad | [
"MIT"
] | null | null | null | cajitos_site/users/routes.py | OlgaKuratkina/cajitos | 0bc13f71281a1a67c8bcd1a3ae343ad0b14d9bad | [
"MIT"
] | 7 | 2020-05-08T19:51:22.000Z | 2022-03-11T23:37:57.000Z | cajitos_site/users/routes.py | OlgaKuratkina/cajitos | 0bc13f71281a1a67c8bcd1a3ae343ad0b14d9bad | [
"MIT"
] | null | null | null |
# Disbaled temporarily or forever
# @users.route("/register", methods=['GET', 'POST'])
| 40.967105 | 120 | 0.696965 | import markdown
from flask import redirect, url_for, flash, render_template, session, request, current_app, abort
from flask_login import current_user, login_user, logout_user, login_required
from cajitos_site import bcrypt
from cajitos_site.users import users
from cajitos_site.users.forms import RegistrationForm, Log... | 0 | 4,597 | 0 | 0 | 0 | 668 | 0 | 438 | 427 |