blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
4a38e9ab30f4407e761d583894ba2f66fd91c3cb | 448415cfb5965c0b158fbdf6e20f70d7c0c157f9 | KorvinSilver/Symlinker | /symlinker.py | Python | py | 17,058 | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Project: Symlinker
A tool to create, search and find symbolic links, or modify their
destinations.
Copyright 2018, Korvin F. Ezüst
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You m... |
9f97b3e4f40df500bf1d5bc8e950249f13af47d7 | 022f19e41562a6c7f9f7e6cd9e88508c98f80690 | HWatBobby/PhoenixAdult.bundle | /Contents/Code/siteSpizoo.py | Python | py | 5,268 | no_license | import PAsearchSites
import PAutils
def search(results, lang, siteNum, searchData):
searchData.encoded = urllib.quote('"%s"' % searchData.title)
req = PAutils.HTTPRequest(PAsearchSites.getSearchSearchURL(siteNum) + searchData.encoded)
searchResults = HTML.ElementFromString(req.text)
for searchResult i... |
89a88981155bc3c52ad83bd986ce2926c31b5145 | 79ff247fe590fecf556e674d86b5a55bc0c71f35 | skramazan/Hangman | /brands_list.py | Python | py | 730 | no_license | car_brands = [
'alfa-romeo',
'aston-martin',
'audi',
'bentley',
'bmw',
'cadillac',
'chery',
'chevrolet',
'chrysler',
'citroen',
'dacia',
'daewoo',
'daihatsu',
'dodge',
'ferrari',
'fiat',
'ford',
'honda',
'hyundai',
'infiniti',
'isuzu',
... |
c52b7b8214afbcc57b799795b068baaf406432c8 | f39fbd8c23b2d78432cac63d50957cb6c7157dc5 | pulumi/pulumi-azure-native | /sdk/python/pulumi_azure_native/storagecache/storage_target.py | Python | py | 19,135 | permissive | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . imp... |
16fd71a1dcd3cef6182fd8f9330b2a8e80f8529b | e16596c9a7a8b6f676260d80cbe8b5e796ac02d9 | kmygrock666/job | /APScheduler-2.1.1/examples/interval.py | Python | py | 501 | no_license | """
Basic example showing how to start the scheduler and schedule a job that
executes on 3 second intervals.
"""
from datetime import datetime
from apscheduler.scheduler import Scheduler
def tick():
print('Tick! The time is: %s' % datetime.now())
if __name__ == '__main__':
scheduler = Scheduler(standalone... |
408a1a2f8350a9262163d7f2548b75ea0c7bfd7a | e5bd00ae51e79a9da9d0d0521615cd2d3c03f918 | Yannistan/django-meteo | /weather/tests/test_views.py | Python | py | 1,828 | no_license | from django.test import TestCase
from django.urls import reverse
from weather.models import City
class TestViews(TestCase):
def test_GET(self):
response = self.client.get(reverse('home'))
self.assertEquals(response.status_code, 200)
self.assertTemplateUsed(response, 'weather/weather.... |
47fe7ab775674bd7b4a044154143313d998ad664 | b9d2f93a464b13434bd6716653786c82673eb1b8 | rickyu/mlsimgsearch | /image_search/indexer/scripts/collect_same_search_sample.py | Python | py | 1,971 | no_license | #encoding: utf-8
import json
import MySQLdb
import sys
import urllib2
class Pic2GoodsConvertor:
shark_conn = ""
data_conn = ""
def __init__(self):
self.shark_conn = MySQLdb.connect(host="172.16.0.216",
user="meiliwork",
... |
a2d639a22b971a49df5eb08fcce1f37318aa1664 | 4454552c2fb0aa1734358563d0caec0e151df9cf | gaurav1987singh/learningPython | /for_test.py | Python | py | 261 | no_license | __author__ = 'goldi'
for i in range(1, 6, 3):
print i
else:
print 'The for loop is over'
total=0
for i in range(10):
total = total + i
print('i value ' + str(i) + 'total:' + str(total))
print(total)
for i in range(0, 10, 2):
print(i)
|
14a77ea07622e72761bf94ddaea2597e7ab925af | f23cabe5aef492c270711eb8ae90be95c4672b76 | Drewhines321/spear | /spear/LPR/rgbParser.py | Python | py | 1,070 | no_license | """
RGB Parser Module. by Jed
Usage:
rgbData("fileTo/rgbFile")
rgbData.getMinRange()
rgbData.getMaxRange()
"""
class rgbData:
def __init__(self,filePath):
#Define 3 List for RGB
self.rList = []
self.gList = []
self.bList = []
#Load rgb file
self.rgbF... |
1dde745ad5e43c6c2ce8e10f9dd5126efc14be68 | f89d580f2d6a5d5f7437430321a7b343644301f2 | NHariman/SCS-2018-FINAL_LDA_MODEL | /preprocesssing part 2.py | Python | py | 2,369 | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri May 25 14:13:41 2018
@author: Naomi Hariman
"""
#%%
"""
PART ONE: CONSTRUCTING A VOCABULARY
"""
#load packages
import pickle
import re
import statistics
import nltk
import string
from nltk.stem.porter import *
from nltk.corpus import stopwords
import os
imp... |
8361c3c9979e9d24f1972903fdbd866471eec4f8 | f0e09ab25bb6a81827ad37fdfee03c8cfecd9709 | bayc/wfc_tools | /examples/example_04_modify_floris_to_match.py | Python | py | 4,194 | permissive | #
# Copyright 2019 NREL
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software dist... |
aa187fb60c83437a5be0b0a45ca40a0691b35ba1 | 869e887684ca9ffc23b0f8a6c20de071a06edecb | Rajat2712/Soda_Bottle_AutoML | /train_search-final.py | Python | py | 10,047 | no_license | import os
import sys
import time
import glob
import numpy as np
import torch
import utils
import logging
import argparse
import torch.nn as nn
import torch.utils
import torch.nn.functional as F
import torchvision.datasets as dset
import torch.backends.cudnn as cudnn
from torch.utils.data.dataset import Dataset # For c... |
529dd7835fbc4df967c0a3e38b4436709283dcd5 | d75efb5b24e60916d2d2f60016d69836b5a675c4 | syurskyi/Python_Topics | /125_algorithms/_examples/_algorithms_challenges/pybites/advanced/260/test_lights.py | Python | py | 5,837 | no_license | import pytest
from lights import LightsGrid
@pytest.mark.parametrize(
"arg, expected",
[
# Turn on all lights
(["turn on 0,0 through 9,9"], 100),
# Turn on all lights
# Turn off selection of lights
# Turn on all lights again, intensity should be 100
(
... |
67bed91603165558c61464782c539e3f280cdeab | 12e7c6dea6b4a44de288d1f8a375a235a73124fd | xxtEchjovs44/Research-ReverselyGeneratingWebCode | /code/WORKPLACE/UIED-RICO/lib_ip/block_division.py | Python | py | 4,769 | no_license | import cv2
import numpy as np
from random import randint as rint
import time
import lib_uied.ip_preprocessing as pre
import lib_uied.ip_detection_utils as util
import lib_uied.ip_detection as det
import lib_uied.ip_draw as draw
import lib_uied.ip_segment as seg
def draw_region(region, broad):
color = (rint(0,255... |
88a8debb19a17d3c5784431b55440ac08ac8b53f | 05ec2d777d0697f0be0f693b0756eeb68673a89f | Wassya/kriptobot | /bot.py | Python | py | 1,483 | no_license | # python bot.py
import json
import requests
from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.dispatcher.filters import Text
from aiogram.utils import executor
from aiogram.types import ReplyKeyboardRemove, \
ReplyKeyboardMarkup, KeyboardButton, \
InlineKeyboardMarku... |
5e26b649c584fc8a8d0140a81d80884c65ad061c | 5d9a5b127e62788e9e83c2edc7484117855c1097 | dmetrosoft/seo-audits-toolkit | /server/internalLinks/tasks.py | Python | py | 602 | no_license | import json
import time
from datetime import datetime
from celery import shared_task
from internalLinks.src.internal_links import generate_graph_internal_link_interactive
from .models import InternalLinks
@shared_task(bind=True, name="internal_job")
def internal_links_job(self,url, maximum):
time.sleep(0.2)
... |
7a90dfbf3c01aa86e3f2aae101391d6c326d9c4d | 8605570a8f0c7a4af1b57018cadbb6b207ea7dcc | chakki-works/elephant_sense | /scripts/features/reader.py | Python | py | 740 | permissive | import os
import json
from scripts.features.post import Post
class Reader():
def __init__(self, data_folder=""):
self.data_folder = data_folder
if not data_folder:
self.data_folder = os.path.join(os.path.dirname(__file__), "../../data/processed/items")
def post_iterator(self)... |
2e226ccee7c315a8de2ac3db1b6b6c7f7c3e8995 | b4e6cfb9d2f1c2db5082bc9ef73ab0bf771dc354 | deepalikumar/microblog | /app/cli.py | Python | py | 1,176 | no_license | import os
import click
def register(app):
@app.cli.group()
def translate():
"""Translation and localization commands"""
pass
@translate.command()
def update():
"""Update all languages."""
if os.system('pybabel extract -F babel.cfg -k _l -o messages.pot .'):
... |
f9beae934740a35a673ff3ed1a6b872c5bce3802 | 4bd016f9baed6287c16bdfaaf6c43ec3c3d243c5 | ml-lab/few-shot-ssl-public | /fewshot/data/tiered_imagenet.py | Python | py | 13,669 | permissive | # Copyright (c) 2018 Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell,
# Kevin Swersky, Joshua B. Tenenbaum, Hugo Larochelle, Richars S. Zemel.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in th... |
820d6ce0442213c50e9b76f8b39cb10f8985b835 | d0c0322cd601c551ede400cadd3db52b7c7e9f42 | taylorgibson/ma4110-fa21 | /lab/lab01/tests/q3_3_1.py | Python | py | 2,157 | no_license | test = { 'name': 'q3_3_1',
'points': None,
'suites': [ { 'cases': [ { 'code': '>>> # Fill in the row\n'
'>>> # time = ...\n'
'>>> # with something like:\n'
'>>... |
50536dc774de572e5923159b903bef079194258e | f561f78acd6e819481ecb5d17b2c1fa391421a2b | shivanshu1234/readthedocs.org | /readthedocs/rtd_tests/tests/test_project_views.py | Python | py | 19,701 | permissive |
from datetime import timedelta
from allauth.account.models import EmailAddress
from django.contrib.auth.models import User
from django.contrib.messages import constants as message_const
from django.http.response import HttpResponseRedirect
from django.test import TestCase
from django.urls import reverse
from django.u... |
503a20c1f45c68b7d885b056399f4edc1ebda405 | 1466e73cf87a504aa6b2e612ef6f206321e602b0 | keithhackbarth/python-cardconnect-api | /examples/capture.py | Python | py | 339 | no_license | import cardconnect # noqa
cardconnect.username = 'testing'
cardconnect.password = 'testing123'
cardconnect.base_url = 'fts.cardconnect.com:6443'
cardconnect.debug = True
print("Performing capture ...")
resp = cardconnect.Capture.create(
merchid='496160873888',
retref='110776233356'
)
print('Capture respons... |
abe5dbf93a5226ed302e993538ef9041e61d00a4 | d52f0cc24b07cd27a1eb8a4640781a726395b174 | iconjone/Engineering-102 | /Lab7/Lab7b/Program2.py | Python | py | 1,382 | permissive | # By submitting this assignment, I agree to the following:
# “Aggies do not lie, cheat, or steal, or tolerate those who do”
# “I have not given or received any unauthorized aid on this assignment”
#
# Name: Jonathan Samuel
# Section: 510
# Assignment: Lab7b
# Date: 10/11/18
def getVectors():
A = input(... |
c088f22869cf15f05c687ef4e176ccf72cc2a5c2 | d589883f1fc40000eb7028faea1bd2bf9ed50c90 | marcduby/MachineLearningPython | /DccKP/PySpark/Cojo/cojoFinalResults.py | Python | py | 4,560 | no_license | from pyspark.sql import SparkSession
from pyspark.sql.types import IntegerType, StringType
from pyspark.sql.functions import col, input_file_name, regexp_extract
from pyspark.sql.functions import lit
import argparse
import functools
def unionAll(dfs):
return functools.reduce(lambda df1,df2: df1.union(df2.select(d... |
bd017ff81819bc6c65e7a1613a482d4168dbb941 | 651d9c4d38ab802e79712ec45edc8c7f55509dd9 | Rimm249/videos | /_2020/chess.py | Python | py | 155,234 | permissive | from manim_imports_ext import *
def boolian_linear_combo(bools):
return reduce(op.xor, [b * n for n, b in enumerate(bools)], 0)
def string_to_bools(message):
# For easter eggs on the board
as_int = int.from_bytes(message.encode(), 'big')
bits = "{0:b}".format(as_int)
bits = (len(message) * 8 - l... |
2002cef8b8aab7b379bf60694b4c75ba962ec1d5 | 780535c81bc117e86120ef0829be72dcc6f9e9dc | fkurushin/demo_wbhack | /find_search_tags.py | Python | py | 2,022 | no_license | import joblib
import numpy as np
from scipy import spatial
from gensim.similarities.annoy import AnnoyIndexer
from pymystem3 import Mystem
class FindSearchTags(object):
"""docstring for FindSearchTags."""
def __init__(self):
self.modelW2V = joblib.load('model_files/word2vec.pkl')
self.embeddi... |
ddefdff213c88c0df6d87c6d51d1c13d7951f2c8 | 2aa2c8c47d7381de182af3a4bfe0c1fe524e1351 | jsbarbosa/pi-circuit | /web/app/migrations/0003_delete_user.py | Python | py | 282 | no_license | # Generated by Django 2.0 on 2017-12-02 15:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0002_user_password'),
]
operations = [
migrations.DeleteModel(
name='User',
),
]
|
e6b3454b5523c83c43ee0348ceea87032fd7f51f | b3449f6d4b8654ac1e6c893b6cbb1ff5c0f753ee | RKouchoo/TensorDetect | /Constants.py | Python | py | 562 | no_license | ###########
'''
CONSTANTS:
The class that stores all of the constants for the application
'''
##########
'''
The vision constants which are used on the robot
'''
class vision:
CAMERA_WIDTH = 240
CAMERA_HEIGHT = 320
DEFAULT_CAMERA = 0
'''
The class that stores the network constants
'''
class net:
RO... |
51adc152050a1ae3ec9add5f1bc215ddd74398c8 | 3ac4a7206e283db6f464da9910458d591e4b66db | kiyoung-Lee/ReactNative-ListViewSample | /task/sample/venv/Scripts/pip3.6-script.py | Python | py | 425 | no_license | #!C:\Private\Git\react-native_sample\task\sample\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3.6'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '',... |
daef7710109e998f6f44b44671c94b49daad1cb6 | 56fc3aa16af3a0ca85196f8bf0de88c000b69aeb | Royal-Society-of-New-Zealand/NZ-ORCID-Hub | /orcid_api_v3/models/work_title_v30.py | Python | py | 4,834 | permissive | # coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... |
0ef86cf60bca79a0e6f824e2fda97e87035741ed | cfe6378105b3a2eabf31c698f1cc65774dd9eaa7 | lcsouzamenezes/deepstar | /deepstar/plugins/overlay_transform_set_select_merge_plugin.py | Python | py | 3,938 | permissive | import os
import cv2
from deepstar.filesystem.transform_file import TransformFile
from deepstar.filesystem.transform_set_sub_dir import TransformSetSubDir
from deepstar.models.transform_model import TransformModel
from deepstar.models.transform_set_model import TransformSetModel
from deepstar.util.debug import debug
... |
29f601036fc878de87fb1566428d02c5eea94fc2 | b47e881eb15dc735e7334b06eb0cf7437e31023e | ahmeda14960/fist | /spirl/configs/skill_prior_learning/maze_bottom/hierarchical_cl_state_gc_4M_B1024/conf.py | Python | py | 1,313 | permissive | import os
from spirl.models.closed_loop_spirl_mdl import GoalClSPiRLMdl
from spirl.models.skill_prior_mdl import SkillSpaceLogger
from spirl.utils.general_utils import AttrDict
from spirl.configs.default_data_configs.maze import data_spec
from spirl.components.evaluator import TopOfNSequenceEvaluator
from spirl.data.m... |
48d26b64a07e76d234f5df9ef02635338561d206 | 6639280c3e52bf8d095a9e34cf93568ffa6db4d2 | sourcery-ai-bot/Python-Curso-em-Video | /python_exercicios/desafio101.py | Python | py | 751 | permissive | # Crie um programa que tenha uma função chamada voto() que vai receber como parâmetro o ano de nascimento de uma pessoa,
# retornando um valor literal indicando se uma pessoa tem voto NEGADO, OPCIONAL e OBRIGATÓRIO nas eleições.
def voto(anonasc):
from datetime import date #Importação do módulo dentro da função ec... |
ec43ef6522c7000a7c08ac3e4adc55f10cb72236 | 439028a25fa1496755271e59fc50248f9321a51a | duongt3/LMhackathon | /ResNet_Pytorch.py | Python | py | 8,690 | no_license | import os
import torch
import torchvision
import numpy as np
import torch.nn as nn
from torchvision import transforms
from torchvision.datasets import MNIST
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
class block(nn.Module):
def __i... |
ffe1db677c05efbf6c8c4f79313ebeb8dbabd296 | a044c22bb5218e7b8b4fdf577b8e3ebba9864880 | cash2one/xai | /xai/brain/wordbase/otherforms/_jumped.py | Python | py | 216 | permissive |
#calss header
class _JUMPED():
def __init__(self,):
self.name = "JUMPED"
self.definitions = jump
self.parents = []
self.childen = []
self.properties = []
self.jsondata = {}
self.basic = ['jump']
|
faa02a5e4642ce9dabb93474878f294a5d62c882 | 6983cece979b2df7c135a91a185a0d125db43b93 | cutsma/cle | /cle/__init__.py | Python | py | 756 | permissive | """
CLE is an extensible binary loader. Its main goal is to take an executable program and any libraries it depends on and
produce an address space where that program is loaded and ready to run.
The primary interface to CLE is the Loader class.
"""
__version__ = (9, 0, "gitrolling")
if bytes is str:
raise Except... |
0ae6e0c86a7d2ae485084a4a89be7408b61bcbc6 | 437b669863254b8024f7242f5d91bca0ad74aaa6 | silverpond/smoothness_from_imu | /scripts/imupaper/complexanalysis.py | Python | py | 25,871 | no_license | """Module containing the necessary variables and functions for generating and
analysing smoothness from the virtual IMU during complex reaching movements.
"""
import numpy as np
import json
import sys
import matplotlib.pyplot as plt
import glob
import pandas as pd
import seaborn as sb
# sys.path.append("../scripts/")... |
2536d4db8725e3c1f09e6beb6ac94d66f604170d | 9d684228e4b26c4f52aece924ba00864621515e2 | danieledwardharrington/GamingStatsProject | /src/UserFile.py | Python | py | 1,242 | no_license | from SteamUser import *
from Global import *
import pickle
import logging as log
class UserFile:
log.basicConfig(filename = LOG_FILE_NAME, level = log.DEBUG, format = LOG_FORMAT)
steam_user = SteamUser()
def __init__(self, steam_user = SteamUser()):
log.info("Steam user init called")
sel... |
468d6ae1b52afb7efb1d289738cd495252dddb62 | e202b6158ac63132ad53b46de68320ec53c2608b | mornydew/alfred | /alfred/modules/data/voc2coco.py | Python | py | 5,648 | permissive | #!/usr/bin/python
# pip install lxml
import sys
import os
import json
import xml.etree.ElementTree as ET
from alfred.utils.log import logger as logging
START_BOUNDING_BOX_ID = 1
PRE_DEFINE_CATEGORIES = {}
# If necessary, pre-define category and its id
# PRE_DEFINE_CATEGORIES = {"aeroplane": 1, "bicycle": 2, "bird"... |
f40de69cf3cdf9436ed6fa9d48a14916ea903a84 | c7877da7a587e4a9abfa8fbb6cc3f7c32f588650 | blairtl/Labs | /Lab 9/lab9.py | Python | py | 275 | no_license | import json
import requests
print("")
print("This is the print before the api is called.")
print("")
r = requests.get('http://localhost:3000/')
data = r.json()
print("")
print("This is the print after the api is called.")
print("")
print(data('name')[0]['color'])
pause |
babe39119e7e508e16618e20af9e7181f76c0aa8 | a9c58c9d66afe53f53e7b49b73a565bff51da556 | AndraRaco/AI | /Minimax Algorithm and Alpha-Beta pruning/Draughts or Checkers.py | Python | py | 23,899 | no_license | # Dame
import time
import copy
import sys
def move(matrice, pozitie, d, jucator):
# pozitia = pozitia noua
# d[0] - element din vectorul de directii
# d[1] - pozitia veche
# facem mutarea si scotem piesele pe care le sarim
# Transormam toate piesele pe care le gasim in drumul nostru de la pozit... |
8e1fc4690e4abc0098de9a087f40030c2c5d4b9c | 97a92995a4f30679ce97bd7bc6939b407f4cdb5c | 1765155167/C-Java-Python | /Python/do_iter.py | Python | py | 1,568 | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import Iterable, Iterator
def g():
yield 1
yield 2
yield 3
print('Iterable? [1, 2, 3]:', isinstance([1, 2, 3], Iterable))
print('Iterable? \'abc\':', isinstance('abc', Iterable))
print('Iterable? 123:', isinstance(123, Iterable))... |
953b613f736f31183e22a6b731d2fadd4fadf0bb | 14d8b609c4101d2763346db6840d6d9dcc480a0d | zukon/e2plugins | /ChocholousekPicons/src/plugin.py | Python | py | 71,106 | no_license | # -*- coding: utf-8 -*-
###########################################################################
# Enigma2 plugin, ChocholousekPicons, written by s3n0, 2018-2020
###########################################################################
###########################################################################... |
0aeb42e646744d3fa0e17f87264e144ab6d12a16 | 6d8126e1422bf751e1d9775956a713036b5034d7 | arbaird/DeadButNotOut | /src/map.py | Python | py | 6,153 | no_license | from data import *
from res import Resource
class Map:
game=None
def __init__(self, arrayMapData, rMapTiles, mapTerDesc):
self.iMapWidth=arrayMapData[0].__len__()
self.iMapHeight=arrayMapData.__len__()
self.position=(0,0)
self.path=rMapTiles
self.rMapTiles=Reso... |
1fe82346a53f6ad6a5b1e2ec0f8c685ce45c27e5 | 76c595f2dd7d05086e419ef2cc54a334b68de503 | ChulanZhang/models | /official/vision/beta/projects/yolo/modeling/backbones/darknet_test.py | Python | py | 4,150 | permissive | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
aae682b733581ab7f6f8f74a5bf3acc09020ca41 | 3cc09f017deeaaf861a8cf6357365115f053d6c4 | cx-z/Dirstributed-Cloud | /DataCenter/SFC.py | Python | py | 2,725 | no_license | # -*-coding:utf-8-*-
import os
from Container import Container
from OpenvSwitch import OpenvSwitch
import config
class SFC:
def __init__(self, id: str, src: str, dst: str, containers: list, offtime, password: str) -> None:
super().__init__()
self.id: str = id
self.src: str = src
se... |
22b8fc9b303ba5128240cfb3dbc6d28b430fb59f | 6210209d7592605f4a0978d1468a03388e2e8453 | RealHomoBulla/Beetroot_Academy_Homeworks | /Lesson_18/Lesson_18_Task_2.py | Python | py | 1,251 | no_license | '''Task 2
The sys module.
The “sys.path” list is initialized from the PYTHONPATH environment variable.
Is it possible to change it from within Python? If so, does it affect where Python looks for module files?
Run some interactive tests to find it out.'''
import sys
print(sys.path)
# ['/Users/homo_bulla/Py/GitHub/Les... |
c884b2577136bce3ed4b26204ee433bd0981bb83 | 5349fda999839abeb75c972cb26902c6b8200b71 | BerilBBJ/scraperwiki-scraper-vault | /Users/W/wendel18/altoona.py | Python | py | 1,116 | no_license | import scraperwiki
html = scraperwiki.scrape("http://web.archive.org/web/20110514112442/http://unstats.un.org/unsd/demographic/products/socind/education.htm")
print html
import lxml.html
root = lxml.html.fromstring(html)
for tr in root.cssselect("div[align='left'] tr"):
tds = tr.cssselect("td... |
8a6b732c35b86620ce4ec4ce3c8232ffa2f9eed7 | f41440ee559fa720e3a9747f1b96419205598c54 | Yoogur/django-vue | /server/views.py | Python | py | 1,009 | no_license | import json
from django.core import serializers
from django.http import JsonResponse
from django.shortcuts import render
# Create your views here.
from django.views.decorators.http import require_http_methods
from server.post.view import add_post
@require_http_methods(["GET"])
def add_book(request):
response =... |
797c81db89e9ae6ebb8d3b586d439fdf158298e2 | 2dcb0b71d3541d4d67745d7ec008d893e3c56ce7 | Eva-Kravets/django_recipesite | /recipe/admin.py | Python | py | 1,866 | no_license | from django.contrib import admin
from .models import *
class DishAdmin(admin.ModelAdmin):
list_display = ('id', 'title', 'photo', 'is_published')
list_display_links = ('id', 'title')
search_fields = ('title', 'content')
list_editable = ('is_published',)
list_filter = ('is_published', )
prepopu... |
dc84d4b7bc94c14e4f11a8105dfd9905662bc469 | f0edbb15d131eec2baf32e20650b9f8b07e749f7 | shannon-heh/winterbreak | /app/src/App.py | Python | py | 13,475 | no_license | import base64
import bcrypt
from flask import Flask, request, jsonify, make_response, render_template
from flask_pymongo import PyMongo
import googlemaps
from datetime import datetime
import json
app = Flask(__name__)
# MongoDB API Key
with open('mongo.config', 'r') as f:
app.config['MONGO_URI'] = f.read()
mongo ... |
02b92aa0ddedb92242d7693961ce1cf50fa19802 | 6d1dfd91552eb6f6f987523f2327c77365d16bdf | vishal3410/Attention-Mechanism | /Multi-Task Learning With Attention Learning/Code/visual_decathlon/model_wrn_eval.py | Python | py | 13,183 | no_license | import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
import torchvision
import numpy as np
import torch.optim as optim
import pickle
import argparse
from torchvision.transforms import transforms
parser = argparse.ArgumentParser(description='Visual Decathlon Challenge: Evalu... |
4b9517e1f9c9dbb549bef664f51f09ab57f16eec | 1383e3fe7f9adf4a7c8bb673703f06dec832c3cb | anmolharsh/Apartment-Management-DBMS_1 | /Apartment_Management/accounts/forms.py | Python | py | 1,336 | permissive | from django import forms
from .models import Resident,Watchmen
from django.db import models
from phonenumber_field.modelfields import PhoneNumberField
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
class WatchmenSignup(forms.ModelForm):
class Meta:
model... |
6c65b0f47cdf2996b0c0147ca33c25c3a5170df9 | 33ab076fa1050e330470627fabdf233066b6dd2d | rust-skia/depot_tools | /recipes/recipe_modules/gsutil/api.py | Python | py | 10,312 | permissive | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import contextlib
import re
from recipe_engine import recipe_api
class GSUtilApi(recipe_api.RecipeApi):
def __init__(self, env_properties, *args, **kwar... |
e4e90fe8b749f580c20c8b2f45fd9bb2a7c42a76 | 77a0163017d0dcebda2138258698d93075674324 | OumaimaHourrane/ClosedDomainQA | /src/clean_dataset.py | Python | py | 871 | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 7 17:56:48 2020
@author: jonas
@title: clean_dataset
@descriptions: set of functions that enable splitting and cleaning.
"""
#%%
import pandas as pd
import numpy as np
import string
from itertools import chain
from textwrap3 import wrap
def s... |
17fd9a0f8acad09e4121fffc53ca3b97b6303525 | eeeb1ae8fbfcdc7a996654c3f35e29011c2413c3 | pangeo-forge/pangeo-forge-recipes | /tests/test_serialization.py | Python | py | 3,694 | permissive | from dataclasses import asdict, dataclass
from datetime import datetime, timedelta
from typing import Callable
import pandas as pd
import pytest
from pangeo_forge_recipes.patterns import ConcatDim, FilePattern, FileType
from pangeo_forge_recipes.serialization import dict_to_sha256, either_encode_or_hash
# TODO: revi... |
6c326e1551e8434688781b597107f8c98eaa2f1c | 48e492337c8ca681fb2a6b94b02e6ff6d1712b45 | pineman/code | /chall/codesignal/intv/array/sudoku2.py | Python | py | 2,695 | no_license | """
Sudoku is a number-placement puzzle. The objective is to fill a 9 × 9 grid with numbers in such a way that each column, each row, and each of the nine 3 × 3 sub-grids that compose the grid all contain all of the numbers from 1 to 9 one time.
Implement an algorithm that will check whether the given grid of numbers ... |
6eb7dda02a9cc9dca66bb1df7eaa9b6f020fbb66 | 1f58ff38140deecb31b004ef1ff2947d298e60a1 | nathanph/uppercase | /TCPServer.py | Python | py | 707 | no_license | #!/usr/bin/python3
from socket import *
from threading import *
serverPort = 12000
serverSocket = socket(AF_INET, SOCK_STREAM)
serverSocket.bind(('',serverPort))
serverSocket.listen(5)
# Send uppercased strings back to client.
def uppercase(connection_socket):
while True:
sentence = connection_socket.recv(... |
d3bd6b21ef82686a11b8e04a4c783249c1a35fa7 | d5d203daeb2f3d95fe8f8a1afa0d1720b7209793 | magnet-cl/django-tastypie-project-template | /base/choices.py | Python | py | 1,340 | no_license | # -*- coding: utf-8 -*-
"""
This document defines choices to be used on the models
"""
AREA_CODES = (
(35, 'ALGARROBO'),
(65, 'ANCUD'),
(45, 'ANGOL'),
(55, 'ANTOFAGASTA'),
(41, 'ARAUCO'),
(58, 'ARICA'),
(42, 'BULNES'),
(55, 'CALAMA'),
(52, 'CALDERA'),
(73, 'CAUQUENES'),
(52,... |
2fed47b320c851f3598df4b29b6c4e059470ae57 | 6f7c44d7abe186396fa8886468cab8fab3451b1b | savadev/LeetCodeProblemSet | /implementstrstr.py | Python | py | 402 | permissive | #!/usr/bin/env python3
class Solution(object):
def strStr(self, haystack, needle):
"""
:type haystack: str
:type needle: str
:rtype: int
"""
return haystack.index(needle) if needle in haystack else -1
if __name__ == "__main__":
s = Solution()
haystack = "h... |
23666e165a9ab9355cc2ac5ed0d16ac035d8c7fa | aab3d4f5f12bd4a5fe208720db86951931841eef | fairbanks-dot/ldp_scripts | /PRJ_parser1_tester.py | Python | py | 5,129 | no_license | #!/usr/bin/env python3
# *********************************************************************************************
# *********************************************************************************************
# Parser_tester.py
# author - Troy Hicks, troy.hicks@alaska.gov
#
# **** Most recent revision d... |
7f5fd9c81e6bda5a5aa8aa8a6050240b6c16b5de | 46e1d4ef752fa93b96d2ec3b61a4cd11bea6fb72 | TrellixVulnTeam/Demo_933I | /leetcode/977.Squares of a Sorted Array.py | Python | py | 1,156 | no_license | # Given an integer array nums sorted in non-decreasing order, return an array of
# the squares of each number sorted in non-decreasing order.
#
#
# Example 1:
#
#
# Input: nums = [-4,-1,0,3,10]
# Output: [0,1,9,16,100]
# Explanation: After squaring, the array becomes [16,1,0,9,100].
# After sorting, it become... |
6fd3d1aa62015c6a754eebda778f5bc5833a9f66 | c09faefe5913d82b5928248f6269d7a4b3b47246 | KevBarbour/RASSblogv1 | /mysite/mysite/settings.py | Python | py | 3,054 | permissive |
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
# SECURITY WARNING: keep th... |
4506f832047053b17c55d3e47a2f4ca5e8d7038b | b653d33371b10a31c4e356803662670d54cdd306 | lostact/SearchAndDefuse | /PythonClient/ai.py | Python | py | 45,780 | no_license | # -*- coding: utf-8 -*-
# python imports
from __future__ import print_function, division
import random
from collections import deque
import time,os
# chillin imports
from chillin_client import RealtimeAI
# project imports
import extensions
from cluster import kmeans
from ks.models import (World, Police, Terrorist, ... |
f18ee87d749161b081996a4aa9f9981dbfc78c3c | 6302c96aa665a71301f3ec3483e4702a8b9a74e4 | mateusztront/zwrotnica | /PycharmProjects/pythonProject3/Egzamin 2 vol 2.py | Python | py | 2,675 | no_license | import psycopg2
import psycopg2.errors
from connection import connect
sql = """
CREATE DATABASE db_exam
"""
def db_create():
try:
conn = connect()
cursor = conn.cursor()
cursor.execute(sql)
except psycopg2.errors.DuplicateDatabase as err:
return err
except psycopg2.Operatio... |
6362ed7130e0a387177ff4ad4d97cb94712c96c3 | fb2f095f71820f6bc8dc9f48783ed43218fcbb5b | BackupTheBerlios/pida-svn | /tags/merged-0.3/pida/services.old/versioncontrol.py | Python | py | 7,873 | no_license | # -*- coding: utf-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
#Copyright (c) 2005 Ali Afshar aafshar@gmail.com
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restr... |
f7608dc61c1b182f01157c5349841b1a41e9bb44 | 4d38f42c33616162be10bef1c1afa712e8922889 | DPS0340/starcraft-macro | /src/locations.py | Python | py | 659 | no_license | create_location = (411, 47)
name_location = (1004, 239)
ok_location = (1432, 865)
cancel_location = (1440, 970)
menu_location = (793, 1057)
end_mission_location = (982, 557)
surrender_location = (978, 334)
end_ok_location = (1461, 991)
error_ok_location = (961, 690)
quit_location = (875, 345)
ok_pixel_locat... |
07a71040a0f633d8babf5d7e98d50d83ebf845c4 | f85c90e63b6981e0965fc2f3a76a74ba8ffa4327 | Dharit-shah/Crud | /crudexample/settings.py | Python | py | 7,156 | no_license | """
Django settings for project project.
Generated by 'django-admin startproject' using Django 3.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib im... |
756305dc28165b803ee77f08e8dacf134c0e6eca | 48bb1b58491fa602793215095a5dd8faefcd46b8 | mokkang/veracode-api-clients | /restapi/swagger/web_app_scanning_config_service_api_1.0/python-client-generated/test/test_scan_url.py | Python | py | 908 | no_license | # coding: utf-8
"""
Veracode Web Application Scanning Configuration Service API
Web Application Scanning Configuration API Documentation # noqa: E501
OpenAPI spec version: 1.0
Contact: veracode@veracode.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ im... |
28037b689905d5104ec7d858cc7039237d22ae9a | e7c76afac03d7a6b62dfb39c90857e0d795a41c0 | zakarya23/ai_project | /PartB/DOMINATORS/utility.py | Python | py | 5,672 | no_license | import math
from numpy import inf
from DOMINATORS.helpers import pairs
def piece_dict(state):
'''
Finds total number of each piece for
us and opponent
'''
opp_piece_dic = {'r': 0, 'p': 0, 's': 0}
our_piece_dic = {'r': 0, 'p': 0, 's': 0}
ours = state['board'].our
opponent = state['boar... |
b9019957b6669a16ef160b71e94ad90ffc020972 | ca1a2b1f4cd9d8c39a0b2bbfcfd801c3e1663a7c | voxelv/impulse_prototype | /impulse_lib/IntMenu.py | Python | py | 861 | no_license |
class IntMenu:
def __init__(self, title, opts):
self.title = title
self.options = {}
for opt_num, opt_info in enumerate(opts):
self.options[opt_num] = opt_info
def __str__(self):
ret_str = list()
ret_str.append(self.title)
for opt_num, opt_info in s... |
ba3ef15395da88dc7e8d5025270f22de79483162 | e6e41046c2acf2aa48e498c56f9cc1642a06b151 | Faroo10/CognitiveTasks | /VSTMPsychopyFiles/VSTM_CirclesInGridStaircase_v1.py | Python | py | 16,537 | permissive | from psychopy import locale_setup, gui, visual, core, data, event, logging
import numpy as np # whole numpy lib is available, prepend 'np.'
import os # handy system and path functions
import sys # to get file system encoding
import random
# Nagel IE PNAS 2009
print("Starting VSTM")
# Visual Task components
# circl... |
affc2b6bd70620d45a5aea7cc14f5ac4d6d0bda8 | fc3de6d28e3ad1ec571054331f6220a03768d40b | wanrongz/PAPRIKA | /rowexp_new_batch.py | Python | py | 4,045 | no_license | import numpy as np
from toimport import *
from scipy.stats import norm
from scipy.stats import truncexpon
from scipy.stats import bernoulli
from scipy.special import comb
class rowexp_new_batch:
def __init__(self, NUMHYP, numdraws, alt_vec, mu0, mu_alt_vec, pi):
self.numhyp = NUMHYP
self.alt_vec... |
b8ee90dd646f834a0fa6496fc2e524085d8b7481 | 8f293cce06f5cfea5ca05992a0af30b1cad61c27 | ps793/SBL-RetinaNet | /train_back.py | Python | py | 7,273 | no_license | from __future__ import print_function
import os
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision
import torchvision.transforms as transforms
from loss_back import FocalLoss
from retinanet import Ret... |
a89eed3585afd78c0a56700205d0d33239a95b6f | 3c4e43821c44f4f7588dad501ec2e321791fa0b6 | LeyangZhang/AttentionBased-SpeechToText-System | /dataloader.py | Python | py | 3,498 | no_license | import numpy as np
import torch
from torch.utils.data import Dataset
from torch.nn.utils.rnn import *
'''
Loading all the numpy files containing the utterance information and text information
'''
def load_data():
speech_train = np.load('train_new.npy', allow_pickle=True, encoding='bytes')
speech_valid = np.loa... |
1c4a8506a28b4fc665b73c2951f21ea3303479ca | 2544221cbc45c207d2fe124937a2d06c61eb3e6c | JorgeWhite/Twitch-Bot | /BotProject/main.py | Python | py | 1,984 | no_license | """
COPYRIGHT INFORMATION
SOME CODE IN THIS FIEL SIS LICENSED UNDER THE APACHE LICENSE, VERSION 2.0.
http://aws.amazon.com/apache2.0/
"""
from requests import get
from irc.bot import SingleServerIRCBot
from lib import db, cmds, react, automod
NAME = "YoryiguaitBot"
OWNER = "yoryiguaitbot"
SECOND_OWNER = ... |
ab00aea03fac1de81d427c99b729f745abcaf6f4 | 1d0a25f6031cfbf8bb029d23f41db829376050bb | Abhishekkumar02/Rest_api | /Sum_Api/wsgi.py | Python | py | 391 | no_license | """
WSGI config for Sum_Api project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... |
1acfe40deda07889b9d5952f7221613f3e4f1df1 | 351cef39bd9b5d028ded39b5ae13410fe8587807 | aleklos/RealTime | /notebooks/app.py | Python | py | 2,044 | permissive |
import pickle
from math import log10
from flask import Flask
from flask import request
from flask import jsonify
import numpy as np
class Perceptron():
def __init__(self,eta=0.01, n_iter=10):
self.eta = eta
self.n_iter = n_iter
def fit(self, X, y):
self.w_ = np.zeros(1+X.sha... |
eb19e8d85ac5e4bf75f173c1984483d440eca8bf | 2957b14dafde797d63befb01af413ee9af64d5e9 | ITLTVPo/SimplePython | /SimplePython/Test-Bai25.py | Python | py | 3,065 | no_license | def DocSoThanhChu():
a = ["một","hai","ba","bốn","năm","sáu","bảy","tám","chín"]
b = ["mốt","hai","ba","tư","lăm","sáu","bảy","tám","chín"]
SoAm=False
number = int(input("Nhập số bạn muốn chuyển đổi: "))
if (number <0):
number = 0-number
SoAm =True
if (number==0):
print("... |
afd363e3e8a22e9b846632679ddca6b71f3a4f96 | 443a4cf8aa5f87847874e3bfa2fb81d0825da161 | marialiubarska/xsec_all_MC_tests | /xsec_corr_weights/get_weight_total_and_diff.py | Python | py | 3,085 | no_license | import numpy as np
import pickle, os, sys
pth = '/scratch/mliubar/jupyter_notebooks/xsec_corr_weights/'
extrap_dict = pickle.load(open(os.path.join(pth, 'tot_xsec_corr_Q2min1_isoscalar.pckl'), 'rb'), encoding='latin1')
pth_spl = pth+'splines_flat/'
wf_nucc = pickle.load(open(pth_spl+'NuMu_CC_flat.pckl','rb'), encodin... |
2427b553af612884408351634ed36ce9d7e5b20c | 2e04bd1bb84167281847eb37e6fb4c90bf01b00a | ramukodandapuram/DJango-RESTframework | /Drf/manage.py | Python | py | 801 | no_license | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Drf.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... |
b5e45db23754ed7036f99cccdb6d3de5f382443a | 6846f5db3a3da1162cc38e75746a75bb7e154a36 | tiagonovaes/agora | /agoraunicamp/urls.py | Python | py | 2,386 | no_license | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from . import views
app_name = 'agoraunicamp'
urlpatterns = [
url(r'^$', views.AgoraView.as_view(), name='agora'),
url(r'^mural/$', views.MuralView.as_view(), name='mural'),
url(r'^encerratutorial/$', views.encerraTutorial, name... |
121fa806a45adb1e07c1534a5ebbbbb902a6d1ad | 585ec23c302c3accbf6b951fa360eb5317345ac8 | viet98lx/MC_net | /model.py | Python | py | 1,975 | no_license | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
################### Multi Intent Next Basket Rec Model ####################
class RecSysModel(torch.nn.Module):
"""
Input data: [u_1, u_2, u_3, u_4, u_5, u_i..., u_n]
u_i: ith user's seq
u_i = [b_1, b_2, b_3, ... |
2dfb1c292ddcec3a31e4959527ebb98b74c60468 | 9df53667dc0681bc683c02f7be3548de5ea6c4bb | crflynn/dephell | /dephell/converters/conda.py | Python | py | 4,020 | permissive | # built-in
from io import StringIO
from pathlib import Path
from typing import Optional
# external
import attr
from dephell_discover import Root as PackageRoot
from dephell_specifier import RangeSpecifier
from packaging.utils import canonicalize_name
# app
from ..controllers import DependencyMaker
from ..models impor... |
7d3e1da22f62d9a6d3b25f56d363626be2209579 | c893ebe8d11cb973c37252110b9c929e846986bd | fabianvf/scrapi | /scrapi/processing/elasticsearch.py | Python | py | 5,593 | permissive | from __future__ import absolute_import
import logging
import six
from elasticsearch import Elasticsearch
from elasticsearch.exceptions import NotFoundError
from elasticsearch.exceptions import ConnectionError
from scrapi import settings
from scrapi.base.transformer import JSONTransformer
from scrapi.processing impo... |
f082475de6ca3bfd83e7ec6b32bb8cb8825b3480 | 12715845d5c9275bf57534b8ba583e411ebfe34a | Ridwanullahi-code/python_dictionary_data_type | /dic2.py | Python | py | 977 | no_license | user_profile = {
"user1":{
"name1":{ "surname":"Ajayi", "middleName":"Ridwanullahi", "lastName": "Olalekan"},
"address1":{"state":"osun state", "Town":"ileogbo", "compound": "omoforilu"}
},
"user2" :{
"name2":{ "surname":"Akintade", "middleName":"Halimat", "lastName": "ishola"},
"address2":{"state":"ondo sta... |
3d5a7abfabf340847822597da6d0ad7145b554a6 | 1b67415e0eb215d26ace434bc3e21a0442f8a273 | SkylerTrent/amaterasu_computers | /amaterasu_computers/wsgi.py | Python | py | 415 | no_license | """
WSGI config for amaterasu_computers project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('... |
0a273d364c176445ded282058983730f21a828b5 | a5e2dd11737f7ee1b08ef1a6839730135b78a566 | hanseoyoung1/flask-pybo | /pybo/models.py | Python | py | 2,056 | no_license | from pybo import db
question_voter = db.Table(
'question_voter',
db.Column('user_id', db.Integer, db.ForeignKey('user.id', ondelete='CASCADE'), primary_key=True),
db.Column('question_id', db.Integer, db.ForeignKey('question.id', ondelete='CASCADE'), primary_key=True)
)
answer_voter = db.Table(
'answer... |
0fedc590c8e8a59303a3af728aec104a5c0e1a25 | 94ed0bb49cfd90e16d76213c441bad79d52fe2be | SergeyDo/dailylog | /logmodules/urls.py | Python | py | 1,091 | no_license | from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth import views as auth_views
from . import views
app_name = 'logmodules'
urlpatterns = [
url(r'^logina/$',
auth_views.login,
{'template_name': 'logmodules/login.html'},
name='login'... |
29291f3cf423bc4ac61f1400e753f80762aea9c6 | 1a3539cbcc66a8e1c02770f314194884c4352797 | JeannieShah/django-deployment-example | /learning_templates/basic_app/views.py | Python | py | 367 | no_license | from django.shortcuts import render
# Create your views here.
def index(request):
context_dict = {'text': 'hello world', 'number':100}
return render(request, 'basic_app/index.html',context_dict)
def other(request):
return render(request, 'basic_app/other.html')
def relative(request):
return render(re... |
1c348fb27a4f9ea91f80c1620bffa4ae1d8d714f | 98b638b8e283ddb949c909edc0fafb1f6db69463 | Monty42/DS_and_Python_courses | /GeekBrains/les_1/les_1_task_6 (2).py | Python | py | 1,053 | no_license | # По длинам трех отрезков, введенных пользователем,
# определить возможность существования треугольника,
# составленного из этих отрезков. Если такой треугольник существует,
# то определить, является ли он разносторонним, равнобедренным или равносторонним.
a = int(input('Введите сторону a: '))
b = int(input('Введите с... |
a3e0552b0d7c5ab9b03ae1412da0c2041d61979a | 6fe5ed6698279659cfcdb3a96bb979f043fde6ee | KamikaziZen/NeMo | /nemo/collections/asr/data/feature_to_label.py | Python | py | 5,647 | permissive | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
2a7adede4e580ad89eee149bc1a49e35d1b28382 | 9f9a417f1cdba4c1eb707b1449b80d4166b1670e | 4teamwork/opengever.core | /opengever/meeting/tests/test_unit_commission.py | Python | py | 640 | no_license | from ftw.builder import Builder
from ftw.builder import create
from opengever.testing import MEMORY_DB_LAYER
from unittest import TestCase
class TestUnitCommittee(TestCase):
layer = MEMORY_DB_LAYER
def setUp(self):
super(TestUnitCommittee, self).setUp()
self.session = self.layer.session
... |
49e7694a565736ab794b04b210999e756d8fb371 | 27c03fcf6898744fa31656945c166fd31b0a2ccc | xarem/mf-chsdi3 | /chsdi/models/vector/edi.py | Python | py | 8,888 | permissive | # -*- coding: utf-8 -*-
from sqlalchemy import Column, Integer
from chsdi.models import register, bases
from chsdi.models.vector import Vector, Geometry2D
Base = bases['edi']
class Arealstatistik2009(Base, Vector):
__tablename__ = 'arealstatistik_std_2009'
__table_args__ = ({'schema': 'bfs', 'autoload': Fa... |
db7f33ed4ba2384ee3c9c088096f3a3144c0ebb8 | 525377ebc933672c6a5fc6c1c133b16c55423abc | pmslavin/dmidecode | /dmidecode.py | Python | py | 14,122 | no_license | """
dmidecode memory report parser
BNF for `dmidecode -t memory` output:
decode ::= preamble arrayspec? bankarray
preamble ::= decoder_version SMBIOS_TEXT smbios_version
arrayspec ::= handlehead arrayspec_body
arrayspec_body ::= phys_head arrayspec_lines
arrayspec_lines ::=... |
8730fbd9775e694b1d62adae610d41ff6114bf00 | aa13fc271ea660638fe63ecde494df76e8304df7 | xurror/publication_platform_sample | /contacts/models.py | Python | py | 567 | no_license | from django.db import models
from datetime import datetime
# Create your models here.
class Contact(models.Model):
news_details = models.CharField(max_length=200)
news_details_id = models.IntegerField()
name = models.CharField(max_length=200)
email = models.CharField(max_length=100)
phone = models.... |
7785b7f53bd8cb78f1b08572985c72aa0019536d | c0a84e0e6ace552b0fad44aa8fe8572663a497c3 | AmirAksak/Mytest | /employee/admin.py | Python | py | 686 | no_license | from django.contrib import admin
from employee.models import Employee, Departments, Posts
class EmployeeAdmin(admin.ModelAdmin):
list_display = ('last_name', 'first_name', 'second_name', 'age')
list_display_links = ('last_name',)
search_fields = ('last_name',)
class DepartmentsAdmin(admin.ModelAdmin):
... |
70f84d229c5f662be0bae53c9ffd6fac9043f7e9 | 581977ac3cf210f50f1a0d5c8140319bca183ef4 | KDibble/ASL-to-Text | /src/matchASL.py | Python | py | 2,146 | no_license | # ML imports
from sklearn import svm
import numpy as np
# this is the machine learning wrapper class
class DataCompare():
def __init__(self):
self.clf = svm.SVC() #this is the single class variable
# set up the machine learning algorithm with the specified data
def setData(self, data, targets):
s... |
10e1c6b394a9deb0095d39e4d3bc42ffa8998a81 | c15fe5e1817383f9aaf633f7974f603b5e0351f1 | SpiritualMonkey/python_entry | /38_workout_tracker/main.py | Python | py | 1,376 | no_license | import os
import requests
from dotenv import load_dotenv
from datetime import datetime
load_dotenv()
API_KEY = os.environ['NUTRITION_API_KEY']
APP_ID = os.environ['APP_ID']
NUT_END_POINT = ' https://trackapi.nutritionix.com/v2/natural/exercise'
SHEETY_END_POINT = 'https://api.sheety.co/fb1328f8715a7846e6fb218f820926e... |
6091aeb93811f9f981ef3d50dcc3ecc85d80d278 | ac4d599afdd74cce353fff55523cc522734431b5 | jing928/GreenhouseMonitor | /utils/notifier.py | Python | py | 2,634 | no_license | import json
import requests
from utils.data_access import DataAccess
from utils.file_access import FileAccess
from utils.enums import SensorDataCol, SensorType
class Notifier:
ENDPOINT = 'https://api.pushbullet.com/v2/pushes'
def __init__(self):
token_dict = FileAccess.get_tokens()
self.__to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.