text
string
size
int64
token_count
int64
from subprocess import Popen, PIPE cmd = "echo hello world" p = Popen(cmd, shell=True, stdout=PIPE) ret, err = p.communicate()
127
47
# encoding=utf8 # pylint: disable=mixed-indentation, trailing-whitespace, multiple-statements, attribute-defined-outside-init, logging-not-lazy import logging from numpy import apply_along_axis, argmin from NiaPy.algorithms.algorithm import Algorithm logging.basicConfig() logger = logging.getLogger('NiaPy.algorithms.b...
2,238
942
from ixnetwork_restpy.base import Base from ixnetwork_restpy.files import Files class RIPng(Base): __slots__ = () _SDM_NAME = 'ripng' _SDM_ATT_MAP = { 'RIPng Header': 'ripng.header.ripngHeader', 'Route Table entries': 'ripng.header.routeTableEntries', } def __init__(self, parent):...
854
292
# Generated by Django 2.1.3 on 2018-11-18 02:34 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Conversation', fields=[ ('id', models.AutoF...
1,083
310
import random class Bomb(object): """Represents the Bomb context that modules should compute against""" def __init__(self): super(Bomb, self).__init__() self.valid_battery_types = ['AA', 'D'] self.valid_ports = ['DVI-D', 'Parallel', 'PS/2', 'RJ-45', 'Seria...
6,050
1,680
jogador = dict() partidas = list() jogador['nome'] = str(input('Nome do jogador: ')) tot = int(input(f'Quantas partidas {jogador["nome"]} jogou? ')) for c in range(0, tot): partidas.append(int(input(f' Quantos gols na partida {c}? '))) jogador['gols'] = partidas[:] jogador['total'] = sum(partidas) print(30*'-=')...
1,377
588
#!/usr/bin/env python import asyncio from abc import abstractmethod, ABC from enum import Enum import logging from typing import ( Optional, List, Deque ) from hummingbot.logger import HummingbotLogger from hummingbot.core.data_type.kline_stream_tracker_data_source import \ KlineStreamTrackerDataSource...
2,832
970
import discord from discord.ext import commands import asyncio from datetime import datetime, timedelta import psutil # Bot related commands class Management(commands.Cog): """Bot related commands. Might require some mod powers in your server""" def __init__(self, bot): self.bot = bot ...
23,599
8,252
from Stack import Stack from random import randint class Interpreter(object): def __init__(self,source,input,startx=None,starty=None,dir=None): source = source.strip().split("\n") dim = max(map(len,source)+[len(source)]) self.source = [list(x.ljust(dim,"."))for x in source] self.dim = (len(self.source),len(se...
3,658
1,598
import requests from bs4 import BeautifulSoup import json def loadMasterStock(): url = "http://www.supremenewyork.com/mobile_stock.json" user = {"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_2_1 like Mac OS X) AppleWebKit/602.4.6 (KHTML, like Gecko) Version/10.0 Mobile/14D27 Safari/602.1"} # user = {"User-Ag...
1,826
732
import unittest from selenium import webdriver from tests import Base class WebKitGTKDriverBenchmarkTest(Base.Base): def getDriver(self): return webdriver.WebKitGTK() if __name__ == "__main__": unittest.main()
231
73
#!/usr/bin/env python # # Given a VOC dataset of TENNIS videos dumped at 1920x1080 resolution, this script creates a # scaled and cropped dataset. Even though the cropped zone size is static (1280x720/640x360) # crop scale), the zones themselves are dynamically selected based on the objects locations # (by reading the...
18,442
6,220
"""Tests for core.config.""" import json import yaml from pathlib import Path import pytest import fromconfig def test_core_config_no_jsonnet(tmpdir, monkeypatch): """Test jsonnet missing handling.""" monkeypatch.setattr(fromconfig.core.config, "_jsonnet", None) # No issue to dump even if missing ...
5,454
1,779
#!/usr/bin/env python # # Release script for beholder # import hashlib import urllib from collections import OrderedDict try: from hostage import * #pylint: disable=unused-wildcard-import,wildcard-import except ImportError: print "!! Release library unavailable." print "!! Use `pip install hostage` to fi...
5,353
1,788
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ('cmsplugin_cascade', '0002_auto_20150530_1018'), ] operations = [ migrations.CreateModel( ...
881
268
from API.models import GoesWellWith, Menu def get_goeswellwith_items(menuitem1): entries = GoesWellWith.objects.filter(menuitem1=menuitem1) result = [] if entries.count() <= 0: result.append('None') return result else: for e in entries: result.append(Menu.objects.g...
366
119
from typing import Optional from algorithms.basic_testing import BasicTesting from simulator.controllers.main_controller import MainController from simulator.controllers.map.map_controller import MapController from simulator.controllers.gui.gui_controller import GuiController from simulator.models.main_model import M...
3,949
1,044
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ from odoo.addons import decimal_precision as dp class MrpSubProduct(models.Model): _name = 'mrp.subproduct' _description = 'Byproduct' product_id = fields.Many2one('...
1,445
479
from django.urls import path from .views import ContactCreateView urlpatterns = [ path('',ContactCreateView.as_view()), ]
126
37
# modelo anterior - Enquanto cont até 10 for verdade, será repetido cont = 1 while cont <= 10: print(cont, ' ...', end='') cont += 1 print('FIM') # Usando o Enquanto VERDADE ele vai repetir para sempre, temos que colocar uma condição PARA=BREAK n = s = 0 while True: n = int(input('Digite um número: [Digi...
410
165
import settings import handlers.base_handler import csv class CartogramHandler(handlers.base_handler.BaseCartogramHandler): def get_name(self): return "Lebanon" def get_gen_file(self): return "{}/lbn_processedmap.json".format(settings.CARTOGRAM_DATA_DIR) def validate_values(self, val...
1,124
402
# -*- coding: utf-8 -*- import os import urllib.request from urllib.request import urlopen # 인터넷 url를 열어주는 패키지 from urllib.parse import quote_plus # 한글을 유니코드 형식으로 변환해줌 from bs4 import BeautifulSoup from selenium import webdriver # webdriver 가져오기 import time # 크롤링 중 시간 대기를 위한 패키지 from time import sleep import warn...
11,184
4,174
#!/usr/bin/env python # -*- coding: utf-8 -*- import click @click.command() @click.option('-n', '--name', default='World', help='Greeting partner') def cmd(name): """ Show greeting message. :type name: str """ msg = 'Hello, {name}!'.format(name=name) click.echo(msg) def main(): cmd() ...
358
137
from .bot import ItsnpBot
27
11
# Copyright 2014 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 mojo_lexer import unittest # Try to load the ply module, if not, then assume it is in the third_party # directory. try: # Disable lint check which ...
7,182
2,268
from django.contrib import admin from glue.models import *
59
16
from typing import Any, Dict, List from qmt.infrastructure import WithParts class GeoData(WithParts): def __init__(self, lunit: str = "nm"): """Base class for geometry data objects. Parameters ---------- lunit : str, optional Length unit for this geometry, by d...
444
131
#!/usr/bin/python # # Copyright (c) 2015, Arista Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # Redistributions of source code must retain the above copyright notice, # t...
20,166
5,851
"""Setup configuration.""" import setuptools from furystoolbox import __version__ with open("README.md", "r") as fh: LONG = fh.read() REQUIRES = ['click>=7.0', 'requests>=2.21.0', 'PyGithub>=1.43.4'] setuptools.setup( name="furystoolbox", version=__version__, author="Joakim So...
890
300
#skip.runas import Image; im = Image.open("Scribus.gif"); image_list = list(im.getdata()); cols, rows = im.size; res = range(len(image_list)); sobelFilter(image_list, res, cols, rows) #runas cols = 100; rows = 100 ;image_list=[x%10+y%20 for x in xrange(cols) for y in xrange(rows)]; sobelFilter(image_list, cols, rows) #...
2,120
827
import numpy as np import torch from spconv.pytorch.utils import PointToVoxel from scipy.spatial.transform import Rotation from pcdet.datasets import DatasetTemplate class BaseDataset(DatasetTemplate): """ OpenPCDet dataset to load and preprocess the point cloud """ def __init__(self, data_config, c...
7,110
2,388
""" This is the script containing the calibration module, basically calculating homography matrix. This code and data is released under the Creative Commons Attribution-NonCommercial 4.0 International license (CC BY-NC.) In a nutshell: # The license is only for non-commercial use (commercial licenses can be obtain...
5,840
2,030
from django.apps import AppConfig from django.contrib.admin.apps import AdminConfig class AdminSiteConfig(AdminConfig): default_site = 'Main.admin.MyAdminSite' class MainConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'Main'
270
81
from researchutils.task import plotter
38
9
''' # Amazon Kinesis Construct Library <!--BEGIN STABILITY BANNER-->--- ![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge) ![cdk-constructs: Stable](https://img.shields.io/badge/cdk--constructs-stable-success.svg?style=for-the-badge) --- <!--END STABILITY B...
220,532
61,875
import torch import torch.nn as nn import torchvision.models as models from torch.nn.utils.rnn import pack_padded_sequence class EncoderCNN(nn.Module): def __init__(self, embed_size): super(EncoderCNN, self).__init__() resnet = models.resnet50(pretrained=True) for param in resnet.parameters...
2,752
882
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jul 16 14:36:46 2019 @author: Tawanda """ import sys import argparse from selenium import webdriver from selenium.common.exceptions import NoSuchElementException if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_arg...
965
308
from .base_reader import BaseReader import pandas as pd class SWMMReportFile(BaseReader): """ A class to read a SWMM model report file. """ def __init__(self, path): """ Requires: - path: str, the full file path to the existing SWMM model .inp. """ BaseReader.__...
22,854
7,017
"""Learn ideal points with the text-based ideal point model (TBIP). Let y_{dv} denote the counts of word v in document d. Let x_d refer to the ideal point of the author of document d. Then we model: theta, beta ~ Gamma(alpha, alpha) x, eta ~ N(0, 1) y_{dv} ~ Pois(sum_k theta_dk beta_kv exp(x_d * eta_kv). We perform...
25,917
8,318
from tkinter import * from tax_profiler import TaxProfile from tkinter import messagebox as mb class Example(Frame, TaxProfile): def __init__(self, parent): TaxProfile.__init__(self) Frame.__init__(self, parent, background="lightblue") parent.minsize(width=500, height=200) parent.m...
6,138
2,267
from django.contrib import admin from lms_app.models import Professor admin.site.register(Professor) # Register your models here.
136
40
#!/usr/bin/env python3 from .document import Document from intervaltree import Interval,IntervalTree # from .annotationGraph import AnnotationGraph import logging logger = logging.getLogger(__name__) class normalize: def __setSentencesAndRawText(Document,rootNode): """Build an intervalTree of Annotation...
5,573
1,524
from django.apps import AppConfig class DnireniecConfig(AppConfig): name = 'dnireniec'
93
33
#Ex004b algo = (input('\033[34m''Digite algo: ''\033[m')) print('São letras ou palavras?: \033[33m{}\033[m'.format(algo.isalpha())) print('Está em maiúsculo?: \033[34m{}\033[m'.format(algo.isupper())) print('Está em minúsculo?: \033[35m{}\033[m'.format(algo.islower())) print('Está captalizada?: \033[36m{}\033[m'.format...
479
245
import os import sonic_platform # Constants ==================================================================== PDDF_SUPPORT_FILE = '/usr/share/sonic/platform/pddf_support' # Helper classs class UtilHelper(object): def __init__(self): pass # try get information from platform API and return a defa...
1,444
380
from django.test import TestCase, RequestFactory from .mixins import TwoUserMixin, ProposalGroupMixin, ViewMixin from django.utils import timezone from consensus_engine.views import CreateProposalView from consensus_engine.forms import ProposalForm from consensus_engine.models import Proposal from django.core.exceptio...
2,900
858
from JDI.web.selenium.elements.composite.web_site import WebSite from tests.jdi_uitests_webtests.main.page_objects.w3c_site.frame_page import FramePage class W3cSite(WebSite): domain = "https://www.w3schools.com" frame_page = FramePage(url="/tags/tag_button.asp", domain=domain)
290
104
''' @author: oluiscabral ''' import unittest from creationals.scraper_factory import ScraperFactory from helpers.webdriver_factory import WebdriverFactory from actioners.login_control import LoginControl from ui.login_ui import LoginUI from data_structure.data_ref import DataRef class Test(unittest.TestCase): @cla...
1,382
456
import copy import logging import numpy as np import six import tensorflow as tf from functools import wraps from contextlib import contextmanager from .backend_base import BackendBase, FunctionBase, DeviceDecorator try: from tensorflow.contrib.distributions import fill_triangular except: print("Cannot find fi...
22,917
7,691
from __future__ import absolute_import, division, print_function import cv2 import pandas as pd import numpy as np import six import ubelt as ub from six.moves import zip_longest from os.path import join, dirname import warnings def multi_plot(xdata=None, ydata=[], **kwargs): r""" plots multiple lines, bars, ...
90,257
30,957
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmdeploy.core import FUNCTION_REWRITER @FUNCTION_REWRITER.register_rewriter( 'mmdet.models.roi_heads.test_mixins.BBoxTestMixin.simple_test_bboxes') def bbox_test_mixin__simple_test_bboxes(ctx, self, ...
4,876
1,616
#!/usr/bin/env python3 """This script demonstrates setting properties on a page manually. The script accepts a single command line option, which is a page ID. It will then display information about the properties and update a few of them. Note that this script assumes the database has already been created with requ...
1,060
325
#!/usr/bin/env python3 """Use this file to setup a build environment.""" import os import argparse from support.linux.log import Log from support.docker_wrapper.retroroot import RetrorootDocker CWD = os.getcwd() def parse_args(args): """Parse arguments. :return: The argument object. """ parser = argp...
1,116
324
import coalpy.gpu as g import numpy as np import math import functools from . import prefix_sum as gpu_prefix_sum def prefix_sum(input_data, is_exclusive = False): accum = 0 output = [] for i in range(0, len(input_data), 1): if is_exclusive: output.append(accum) accum += inp...
1,796
628
from torchvision.transforms import transforms from torch.utils.data import DataLoader from torchvision.datasets import ImageFolder import torch as T import torch.optim as optim from model import Generator, Discriminator from loss_fn import GeneratorLoss, TVLoss from utils import show_progress, save import datetime impo...
3,633
1,266
import re ''' Function for Formatting n-grams. @Parameters: Tuple: n-gram to be formatted. @Return: String: formatted gram. ''' def formatGram(ngram): return re.sub("[(',)]", '', str(ngram)) ''' Function for Formatting sentences. @Parameters: Sentence: unformatted sentence. @Return: String: format...
497
155
from datetime import timedelta import commonware.log from celeryutils import task from django.utils.encoding import force_text from tower import ugettext_lazy as _ from mkt.account.utils import fxa_preverify_url from mkt.site.mail import send_html_mail_jinja from mkt.users.models import UserProfile fxa_email_subje...
1,735
542
import sys sys.path.insert(0, '/srv/jpmorgan') from app import app as application
82
28
""" Voronoi Plot ============ """ import numpy as np from sklearn.cluster import KMeans import msmexplorer as msme # Create a random dataset across several variables rs = np.random.RandomState(42) n, p = 1000, 2 d = rs.normal(0, 2, (n, p)) d += np.log(np.arange(1, p + 1)) * -5 + 10 # Cluster data using KMeans kmeans...
449
193
"""This algorithm implements the Wang Generalization algotithm with constraint checking This algorithm simplifies lines. It detects for each line the bends. It analyze the bend and remove the bends that are below a certain diameter. The point and lines that do not need to be simplified are still used to...
40,586
11,399
#!/usr/bin/env python3 import socket port = 12345 MAX_SIZE = 65535 target_address = '127.0.0.1' s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.bind((target_address,port)) s.listen(2) conn, addr = s.accept() # conn: socket is the client socket. print(addr, "Now Connected") text = "Thank you for connecting fro...
393
158
from empyric.adapters import * from empyric.collection.instrument import * class OmegaCN7500(Instrument): """ Omega model CN7500 PID temperature controller """ name = 'OmegaCN7500' supported_adapters = ( (Modbus, {'slave_mode': 'rtu', 'baud_rate': 38400, ...
4,084
1,512
# APACHE LICENSE # Copyright 2020 Stuart Paterson # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
2,468
711
import argparse import json import requests import pathlib from urllib.parse import urlparse from auth import AWSSignatureV4 def create_auth(): return AWSSignatureV4( region='eu-west-1', service='execute-api', aws_access_key=args.access_key_id, aws_secret_key=args.secret_access_ke...
4,945
1,472
""" Simple example set holiday dates (c) 2016 EKM Metering. """ import random from ekmmeters import * #port setup my_port_name = "COM3" my_meter_address = "300001162" #log to console ekm_set_log(ekm_print_log) # init port and meter port = SerialPort(my_port_name) if (port.initPort() == True): my_meter = V4Meter(...
2,074
963
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sun Oct 30 20:11:19 2016 @author: stephen """ from __future__ import print_function from keras.models import Model from keras.utils import np_utils import numpy as np import os from keras.callbacks import ModelCheckpoint import pandas as pd import sys i...
4,242
1,692
import os indentSize=1 #size of the indent class calcs(): def __init__(self): self.indent=0 self.txt=[] #text for each line def clear(self): self.txt.clear() self.indent=0 def addCalcs(self,calc): s=[' ' * self.indent+ t for t in calc.txt] self.txt += s ...
624
212
#!/usr/bin/env python from __future__ import division """MODULE_DESCRIPTION""" __author__ = "Nick Sweet" __copyright__ = "Copyright 2015, Cohrint" __credits__ = ["Nick Sweet", "Nisar Ahmed"] __license__ = "GPL" __version__ = "1.0.0" __maintainer__ = "Nick Sweet" __email__ = "nick.sweet@colorado.edu" __status__ = "Deve...
7,146
2,319
from django.contrib.auth.models import User, Group from django.utils import timezone from django.conf import settings from django.urls import reverse_lazy from apps.projects.models import Project, Client, ProjectContributor from ddf import G from guardian.shortcuts import assign_perm class VulnmanTestMixin(object): ...
7,952
2,516
# -*- coding: utf-8 -*- import numpy as np from torch import load as Tload from torch import tensor from dataloader import read_data,DataLoader,load_init from cdkt import CDKT if 'model' not in dir(): model = CDKT() model.load_state_dict(Tload('model.pkl')) # inits = load_init() data = """0...
2,010
1,588
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: hello.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf impor...
3,958
1,564
''' Sitemap plugin for CKAN ''' from ckan.plugins import implements, SingletonPlugin from ckan.plugins import IRoutes class SitemapPlugin(SingletonPlugin): implements(IRoutes, inherit=True) def before_map(self, map): controller='ckanext.sitemap.controller:SitemapController' map.connect('sitem...
504
152
from typing import Any, Dict, List class Dynamics: """Provides a template for the functionality required from a dynamics class to interface with the experiment wrapper functionality. A dynamics class must implement the following methods: - n_dims: returns the number of dimensions of the state space ...
3,049
824
#!/usr/bin/python # programmer : Bo # usage: Count_Reads_bin.py file_list import sys import re import random import string import time def main(X): try: print 'opening file :',X infile = open(X,"r").readlines() print 'Total ',len(infile),' lines.' return infile except IOError...
2,870
1,102
from collections import deque from copy import deepcopy from slm_lab.agent.memory.base import Memory from slm_lab.lib import logger, math_util, util from slm_lab.lib.decorator import lab_api import numpy as np import pydash as ps logger = logger.get_logger(__name__) def sample_next_states(head, max_size, ns_idx_offs...
6,648
1,994
import yaml import sys Head = "# Dockerfile derived from easy::jit's .travis.yml" From = "ubuntu:latest" Manteiner = "Juan Manuel Martinez Caamaño jmartinezcaamao@gmail.com" base_packages = ['build-essential', 'python', 'python-pip', 'git', 'wget', 'unzip', 'cmake'] travis = yaml.load(open(sys.argv[1])) travis_source...
1,958
726
from api import models from api.twitter_tools.tweet_seeker import TweetSeeker def retrieve_tweets(): tokens = models.Token.objects.all() try: token = tokens[0] except IndexError: token = None t_s = TweetSeeker(token) t_s.run('#vancouver')
278
98
from twisted.internet import task from twisted.names import dns def main(reactor): proto = dns.DNSDatagramProtocol(controller=None) reactor.listenUDP(0, proto) d = proto.query(('8.8.8.8', 53), [dns.Query('www.example.com', dns.AAAA)]) d.addCallback(printResult) return d def printResult(res): ...
390
148
from __future__ import print_function import numpy as np import pandas as pd from sklearn import metrics class Options(object): """Options used by the model.""" def __init__(self): # Model options. # Embedding dimension. self.embedding_size = 32 # The initial learning rate. ...
5,975
1,842
try: from setuptools import setup except ImportError: from distutils.core import setup import versioneer def read(path): """ Read the contents of a file. """ with open(path) as f: return f.read() setup( classifiers=[ 'Intended Audience :: Developers', 'License ::...
1,294
397
from __future__ import division from __future__ import print_function from builtins import range from past.utils import old_div from pypusu.polling import PuSuClient from time import sleep, time if __name__ == "__main__": print("Connecting") c = PuSuClient("ws://127.0.0.1:55000") count = 0 def listen...
1,071
372
# Import libnacl libs import libnacl import libnacl.utils # Import python libs import unittest class TestPublic(unittest.TestCase): ''' Test public functions ''' def test_gen(self): pk1, sk1 = libnacl.crypto_box_keypair() pk2, sk2 = libnacl.crypto_box_keypair() pk3, sk3 = libn...
3,289
1,346
from tkinter import Tk, Frame, Scrollbar, Label, Text, Button, Entry, StringVar, IntVar, TclError from tkinter.messagebox import showerror, showwarning from client import Client from threading import Thread from socket import error as socket_error destroy = False def on_closing(): global destroy destroy = Tr...
2,815
859
"""Django urlpatterns declaration for nautobot_secrets_providers plugin.""" from django.urls import path from nautobot_secrets_providers import views app_name = "nautobot_secrets_providers" urlpatterns = [ path("", views.SecretsProvidersHomeView.as_view(), name="home"), ]
281
98
from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.shortcuts import get_object_or_404, redirect, render from .forms import QuizForm from .models import Quiz def _get_quiz_if_allowed(request, quiz_id): quiz = get_object_or_404( Quiz.ob...
1,920
670
import discord from discord.ext import commands import asyncio import time from enum import Enum class VoteType(Enum): POLL = 1 MUTE = 2 class Vote(commands.Cog): def __init__(self, bot): self.bot = bot self.emojis = { "yes": "\N{WHITE HEAVY CHECK MARK}", "no": "\...
6,757
2,023
import inspect import threading import time from six.moves import urllib from ..errors import ConfigurationError from ..util import get_dependency from .base import Storage class MemcachedStorage(Storage): """ Rate limit storage with memcached as backend. Depends on the `pymemcache` library. """ ...
5,227
1,455
#!/usr/bin/python # -*- coding: utf-8 -*- import os from django.http import HttpResponse, HttpResponseForbidden from django.shortcuts import render_to_response from django.contrib.auth.decorators import login_required from caracole import settings from .decorators import nw_admin_required from .getters import get_de...
4,617
1,447
import requests charset = "abcdefghijklmnopqrstuvwxyz0123456789_{}" password = "HackToday{" url = "http://sawah.ittoday.web.id:40137/" while(password[-1]!="}"): for i in charset: r = requests.get(url) payload = {'password': password+i, 'submit': 'Submit+Query'} r = requests.post(url, data=...
411
153
from __future__ import unicode_literals <<<<<<< HEAD __title__ = 'Mayan EDMS' __version__ = '2.7.3' __build__ = 0x020703 ======= __title__ = 'IITH DVC' __version__ = '2.7.2' __build__ = 0x020702 >>>>>>> 4cedd41ab6b9750abaebc35d1970556408d83cf5 __author__ = 'Roberto Rosario' __author_email__ = 'roberto.rosario@mayan-ed...
484
222
from __future__ import division import pandas as pd import numpy as np import calendar import os.path as op import sys from datetime import datetime from dateutil.relativedelta import relativedelta from scipy.stats import percentileofscore from scipy.stats import scoreatpercentile, pearsonr from math import * import t...
5,728
2,147
from bz2 import BZ2File from pathlib import Path from queue import Queue from threading import Thread from typing import Any, Callable, Dict, Iterator, List, Tuple from xmltodict import parse as xmltodict_parse def parse(dump: Path) -> Iterator[Dict[str, Any]]: def filter(path: List[Tuple[str, Dict[str, str]]], ...
1,212
407
import cv2 import sys,json,numpy as np import glob,os import face_recognition import datetime from pathlib import Path from pymongo import MongoClient from flask_mongoengine import MongoEngine from bson.objectid import ObjectId face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') client = MongoCl...
5,321
1,720
################################### # Created on 22:20, Nov. 16th, 2020 # Author: fassial # Filename: utils.py ################################### # dep import os import pandas as pd import scanpy as sp from collections import defaultdict # local dep # macro # def get_data_lm func def get_data_lm(sce_fname, sparse = ...
929
367
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Created on Mon Jul 10 16:26:41 CEST 2017 @author: BMMN """ import gc # garbage collector import nacl.signing import nacl.encoding def sign(signing_key, message): return signing_key.sign(message) def key_gen(): signing_key = nacl.signing.SigningKey.generate...
1,376
476
# -*- coding: utf-8 -*- # Copyright (c) 2016 Osmo Salomaa # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modif...
17,187
5,625
# Generated by Django 1.10.6 on 2017-03-13 04:46 # Modified by Raúl Negrón on 2019-06-22 16:48 import django.db.models.deletion import django.utils.timezone from django.conf import settings from django.db import migrations, models import apps.core.models class Migration(migrations.Migration): initial = True ...
2,099
539
# -*- coding: utf-8 -*- """ obspy.io.nied.knet - K-NET/KiK-net read support for ObsPy ========================================================= Reading of the K-NET and KiK-net ASCII format as defined on http://www.kyoshin.bosai.go.jp. """ from __future__ import (absolute_import, division, print_function, ...
9,607
3,500
from .base import Dataset from .pandas_dataset import MetaPandasDataset, PandasDataset from .sqlalchemy_dataset import MetaSqlAlchemyDataset, SqlAlchemyDataset
159
48
from flask import Blueprint, jsonify, request, redirect, abort, url_for, render_template main = Blueprint('main', __name__) # routes @main.route('/', methods = ['GET']) def Abort(): return redirect(url_for('main.index')) # abort(403) @main.route('/default.tpl', methods = ['GET']) def index(): title = 'DE A...
379
124