This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const choo = require('choo') | |
| const app = choo() | |
| app.model({ | |
| state: { | |
| name: 'Foo' | |
| }, | |
| reducers: { | |
| receive: (action, state, send) => { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const yo = require('yo-yo') | |
| const onload = require('on-load') | |
| const a = yo`<div>a</div>` | |
| const b = yo`<div>b</div>` | |
| onload(a, () => console.log('a loaded')) | |
| onload(b, () => console.log('b loaded')) | |
| document.body.appendChild(a) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | { | |
| "version": "2", | |
| "header": { | |
| "title": "Vehicle & Pedestrian Investigations", | |
| "description": "Business licenses issued by the Department of Business Affairs and Consumer Protection in the City of Chicago from 2002 to the present. January 1, 2006 to present. Data is updated daily.", | |
| "navigation": [ | |
| { | |
| "label": "Download", | |
| "url": "https://data.cityofchicago.org/api/views/r5kz-chrr/rows.csv?accessType=DOWNLOAD&bom=true" | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | load data | |
| infile '/Users/tim/Sites/property-assessments-pipeline/output/merged_properties.csv' | |
| into table GIS_OPA.PROPERTIES | |
| fields terminated by ',' optionally enclosed by '"' | |
| (location,owner_1,owner_2,census_tract,zip_code,geographic_ward,house_number,suffix,unit,house_extension,recording_date,sale_date,sale_price,unfinished,assessment_date,market_value_date,market_value,taxable_land,taxable_building,exempt_land,exempt_building,category_code,zoning,site_type,frontage,depth,parcel_shape,total_area,topography,garage_type,garage_spaces,off_street_open,view,other_building,number_stories,general_construction,type_dwelling,date_exterior_condition,exterior_condition,quality_grade,year_built,year_built_estimate,number_of_rooms,number_of_bedrooms,number_of_bathrooms,basements,fireplaces,type_heater,fuel,central_air,interior_condition,utility,sewer,separate_utilities,total_livable_area,book_and_page,registry_number,cross_reference,category_code_description,building_code,building_code_description,state_code,st | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 1. PARCEL | |
| <type 'unicode'> | |
| Nulls: False | |
| Unique values: 579912 | |
| Max length: 9 | |
| 2. LOC | |
| <type 'unicode'> | |
| Nulls: False | |
| Unique values: 547180 | |
| 5 most frequent values: | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import sys | |
| import csv | |
| from collections import defaultdict | |
| reader = csv.reader(iter(sys.stdin.readline, ''), delimiter=';') | |
| # Skip header row | |
| reader.next() | |
| grouped_dict = defaultdict(lambda: ['', '', '', 0.0, 0.0, 0.0, 0.0, 0.0]) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | - Art Museum | |
| - Atwater Kent Museum | |
| - Auditing: | |
| - Auditing (City Controller) | |
| - Aviation | |
| - Board of Ethics | |
| - Board of Pensions # See #5 | |
| - Board of Revision of Taxes | |
| - City Commissioners | |
| - City Council | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | valid_depts = [] | |
| with open(DEPT_FILE_PATH, 'rb') as file: | |
| depts = list(load(file)) | |
| for dept in depts: | |
| if isinstance(dept, dict): | |
| for key, matches in dept.iteritems(): # only one of these | |
| valid_depts = valid_depts + [{match: key} for match in matches] | |
| else: | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var filteredDatasets = _.filter(datasets, function (dataset) { | |
| return (!params.organization || (dataset.organization && slugify(dataset.organization) === params.organization)) && | |
| (!params.category || (dataset.category && slugify(dataset.category).indexOf(params.category) !== -1)) | |
| }) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | def where(input, property, value) | |
| return input unless input.is_a?(Enumerable) | |
| input = input.values if input.is_a?(Hash) | |
| input.select do |object| | |
| input_property = item_property(object, property) | |
| input_property.to_s == value.to_s || Array(input_property).include?(value.to_s) | |
| end | |
| end |